Test fixes

Implemented better test coverage for modella. I didn't write tests for sync.js since it's likely to be pulled into its own plugin soon anyway.