Fixed undefined error in strict mode.
Clean up, fix for inability to save changes to a form.
Fixed reference to redundant global variable for getting the directory of the plugin
More code formatting