Added ability to specify an external js file; Set up distinct errors for each call to logError.