Main Javascript file, wrapped in JQuery closure