Convert lib/index.coffee to JavaScript

I tried to keep as close as possible to the original code. All tests are still passing but I haven't done any further testing. 

- [x] Move all Lua scripts into `lib/scripts` as separate `.lua` files.
- [x] Convert to `prototype`-style.
- [x] Remove `Makefile`.
- [x] Make all current tests pass.
- [x] Implement query code tests
- [x] Update to `0.2.3`