Update encode_model and refactor crypt helpers

* Update encode_model from timescapes updates
* Refactor mixin.py to extract out the encryption stuff into crypt.py
* Reset all references to handle_*_encrypt*