Merge pull request #396 from theresaanna/master

JS testing, refactoring (again)