Add a phantomjs test runner for the jasmine tests

Also, add more tests for the xd model.