Support current git HEAD version of phantom

The current git version of phantom seems to have removed phantom.loadModuleSource(), so I refactored things a bit to get around that. Should be backwards compatible with the current phantomjs too.