language: improve API for imports (#402)

Previously, language.GenerateRules was expected to store import
information on generated rules in an unspecified way (proto and go set
a private attribute). It wasn't very clear what to do though, and it's
an important part of implementing new extensions.

With this change, GenerateRules returns a struct with an Imports list
that contains an interface{} for each generated rule. These opaque
values are explicitly passed to Resolve.

Fixes #397
12 files changed