Backport Use a Traverser in JSASTTest instead of a Transformer.

(cherry picked from commit 4752db29e17d5960b18b4aab73c34f83b01a486d)