Replaced path to PhantomJS implementation from hardcoded value to new
environment value 'PHANTOMJS_EXECUTABLE'.
Use charAt() instead of experimental 'endsWith()'.