fix($parse): correctly detect CSP mode via $sniffer

Also fixes the test suite, which was not actually taking CSP-mode paths when
we were expecting it to.

Numerous CSP-mode tests are failing, working on fixing these.
not strictly needed for the fix, but if we want to get rid of anonymous functions..