I've heavily updated the main javascript file.  I've also taken out the functions within the json file.  The main file looks like a complete mess still, needs some heavy work.