I want to get rid of the need for this in models, but it's necessary now. Hopefully we can add something more robust to the baseclass that works automatically. Like a `to_json`, and then corresponding load functions, etc.