Start of refactoring to use parent and module structure.

Also fixes a few typos and missing annotations
Merge in the metadata comparison engineering tool.