Make JS code hint test runs more consistent

I changed the resetting behavior for code hint tests to eliminate uncertainty that is causing some test failures. This change also adds some scaffolding that makes it easier to track down JS code hint issues.

Hopefully fixes #5754. This definitely fixes #5811.