Run some of the files through JSLint, moved a few things around.
Updated the require permissions to look for a permission by name