Refactor and resolve imports and references.
This is still *very* rough, and a lot of logic is guess work and needs verification in capnp c++ source.
Adds references resolution, import resolution and const resolution. This *appears* to parse schema.capnp correctly and fully, but this needs more checking.