First cut at refactoring JavaScript code into a separate module
so that we may be able to run multiple Node versions at once.
Update missing package so that tests run.
Fix temporary directory for tests.