Add support for referencing messages and enums outside of the current scope.

I pass a structure called Proto, the parsed file, around to the function which determines the type of a field.
Examples of use provided in the tests.