Plugin JavaScript code fixes

jshint linter showed several potential problems with the JavaScript code,
all of which have been addressed

additionally the call to "alert" made inside errorHandler has been removed
Merge pull request #117 from stevesims/up-master

Thanks