Filled out the TODO list a bit and refactored the JS to be nicer