Improved javascript unit tests