Organize model.js
Some tests for scope