starting to partition code in models, view, controllers. Also introduced unit testing with Mocha.