Moved some important structures out of the test module.
Squashing together some rather important cosmetic changes.
Merge branch 'master' into output-format