Move Javascript into an IIFE to clear up the global scope

Custom JS should be scoped off by itself to avoid conflicts with other JS libraries that may not be doing it right.
Make second function camelCase for unity and readability