Switch to using classes for I/O formats
Add a JSON registry of formats
Refactor registry to use JSON file
Fix bug in _get_valid_format