Add poltergeist

* Add poltergeist for running tests that need JS
* Move test helpers into their own file