Now using PhantomJS. Basically works but lots of bugs. See comments for details