fjsantosb/Molecule — pull request #6 by christianalfoni (2014-02-22 19:14:20+00:00)
Title: First refactor iteration and included module-loader-tdd into library

So this is the first iteration of the refactoring. It still needs a few iterations, but we are well on our way. The focus in first iteration has been to move code into private methods that are simple input/output (more like input/mutate), but at least they can easily be tested.

Other updates:
- The lib now has its own module-loader (Molecule.module('MyModule', function (require, p) {}) )
- require is used to require other modules and p is an object to add private methods to
- return the object/function to expose to other modules
- INIT and UPDATE are now created with methods ( game.init(function () {}) ), this makes it easier to control what to initiate from within the lib before and after the game created is calling these methods

How to test:
1. run npm install to get the new npm modules
2. run grunt tdd:molecule and go to localhost:3001 in the browser