Added support for setting defaults from tpm.json

- Some additional refactoring to json functions