Move source code to lib
Add Gruntfile

`grunt test` runs tests, and `grunt watch` watches all source files for
any changes, and runs tests automatically if needed.
Add `grunt start` to start xi-core