Tidy up JS startup and additional unit tests.