Major refactoring of registry.py to use JSON registry