JS unit tests

Finalization of the unit tests.