Refactored Model Storage

Move all the model storage code out into another class.