Improved js tests

Added several improvements to the JS Tests in addition to addressing #1359.

See Commits for detailed explanations of fixes.