Code cleanup: moving all the classes into their own files. Also added an example js file