Update to work with phantomjs 1.9

Script wasn't working with newer version of phantomjs.
Re-add exit code.

Accidentally removed exit code.
Merge pull request #373 from GCheung55/patch-1

Update phantom.js script to work with phantomjs 1.9