Fix type signature for the Resolver typedef.
Remove unused getExportReference functions.

These were left over from a much older version of the Matrix.
Remove an unused function from Module.
Fix a whole bunch of types and type annotations.