Carved the humungous amount of javascript code into manageable chunks