Finish decoupling .compat and .codec
Tidy up tests