Add `hacks_for_phantomjs()` method.

Hi @aronasorman - here's the PR for adding the `hacks_for_phantomjs()` method on `nalanda-rct2` branch.