improved and cleaned up js unittests