add support for lazy-loaded tables

also refactor all the things.
- store model configs by string key, not model object, to avoid bugs in
development with class reloading
- remove the partially-developed explicit support for history — opt
instead to treat it like just another kind of has_many relation