Moved JS from index to control.js and initial, experimental work on a plugin.