Support for running phantomas in SlimerJS

Resolves #313