Rationalise Json serialization/deserialization by always putting the
Json format object as an implicit value of the type's companion object,
rather than importing it where needed.
Make json formats lazy so they don't depend on initialization order
(although they're place last anyhow.) Place some enums within a
smaller scope and remove some old cruft.