Added PhantomJS to karma and package.json.
Added a bunch more tests and fixed some bugs at the same time.
Moved karma to live next to test instead of inside.

- This makes running the node mocha tests more simple.