Using the new CodeWithScopeCodec in the DocumentCodec; added tests to cover it.
Tidied up the encoding side of DocumentCodec
Changes to get the Pojo acceptance test running.  Works in IntelliJ but not the command line.