Added/tried some unit tests for the js code