craftyjs/Crafty — pull request #603 by mucaho (2013-11-03 22:17:05+00:00)
Title: Server build - split browser & display context from rest of code

A first attempt to split them, mainly using the philosophy from [this document](https://github.com/mucaho/npm_crafty/tree/master/diff#removed-from-crafty)
* src files have their name appended with "_server" if they represent backend code.
* some files have been split in 2 parts, if a chunk of code didn't fit into either worlds:
** ```extensions``` into ```extension``` and ```extensions_server``` (has only Crafty.keys and Crafty.mouseButtons)
** ```controls``` into ```input``` and ```controls_server``` (has only Multiway, Twoway, Fourway)
** ```animation``` has had it's ```SpriteAnimation``` component removed and put into ```sprite```
** ```drawing``` has had ```Crafty.scene``` & ```zeroFill``` removed and they were put into ```scene_server```
* dummy objects have been added (like ```window```, ```Crafty.viewport```, etc) before & after definition of crafty server build

The old build functionality is intact: all tests pass & api build works.

You can build the server version with ```grunt server``` (as you guessed only the **_server** files get included in the server build). Of course only some qunit tests pass at the moment.
You can run a simple example with ```node test_server.js```.
There is much room for improvement:
* first of all changing the code so that ```src/server/_SERVER_preCrafty.js``` and ```src/server/_SERVER_postCrafty.js``` do not have to be included. (e.g. instead of calling a method directly on ```Crafty.viewport```, we could trigger events that ```Crafty.viewport``` listens to)
* as much of the functionality has been omitted, extensive testing & special qunit tests are needed

Is this the correct approach? The more PRs get merged into develop branch, the harder it will be to merge something like this if we plan to.