split 10,000 lines of client-side JavaScript into multiple files

#226