remove unused code, fix pyflakes and jshint hints