Nashorn support + phantomjs bugfix

Added nashorn support
Fixed bug in phantomjs writer that overwrites the filename variable.