JS cleanup

Please test this to make sure I didn't hose anything - my local examples are all working correctly so I think it is okay. I combed over the qcubed.js file and started to clean up some of the functions. Caching jQuery selectors, organizing things a bit, and getting closer to a jslint-able version. This is nowhere near perfect, but it should slightly improve performance and help make maintenance a bit easier.