divide up into multiple templates

Break up one js file into multiple files.
Easier to manage.