Code cleanups and refactoring for metadata.py and related changes in the wizard and test