Splitting into separate files

there is still an issue with loading the template file.  going to
refactor using require.js