Added tests for JS file functionality
Minor fixes to plugin JS based on tests