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.