Use phantomjs module from npm and make tests run on Windows

I opened #707 a while back, but seeing how nothing has changed in that regard I figured I'd just do it myself.

While I was at it, I noticed that the tests fail to run on Windows because the test server was not expecting Windows-style path separators. I fixed that as well.

I also separated build dependencies and test dependencies in package.json so that by default you only get the build dependencies, and can then install phantomjs and express for testing purposes with `npm install --dev`.

I also fixed one of the ajax tests that was failing on Windows because of linebreak differences (`\r\n` vs `\n`).