Update to Traits-based model, add tests
Merge commit 'a4d8618ffc0cd25199cf2e36dcca17a0169cf7f7'