reworked reference rebinding control flow, improved some comments, and did a little work on the tests
made models 'castable'