Module serialization round tripping with haskell.

packing fixitys into a single byte, like the haskell ermine compiler does.
fixed fixity arbitrary to only generate levels between 0 and 9
fixed digest serialization to write out a byte array instead of two longs.
some other minor cleanups.