Feature/js cleanup

Organized the JS code, using knockout to bind functionality to elements.