moved js into separate files, ran through .jslint