add function 'assert' to JavaScript global

This adds an "assert" function that I believe behaves kind of like the assert! macro, but instead of aborting we throw an exception. This exception is actually catchable which is inline with assertEq used in SpiderMonkey and has never really caused issues.

The idea is that we would remove this function and replace it with something defined in a test harness later.