JS refactor
Merge pull request #13 from paulnorthup/refactor-ms

JS refactor