Cleaned up formatting, comments. Now explicitly calls phantom.exit() at
the end.