Fix Program.assertEqual() second run problem, add tests for it

Summary:
The refactor lost a resetting of output.assertions, which this diff brings back.
That ensures that once you've fixed something, the assertions reset.
I also really wanted tests to prevent future regressions, so I've added those.
Unfortunately, PhantomJS seems to turn nested functions into null, so the
tests were failing for a long time until I figured that out.
Those functions are now stubbed out in worker.js instead.
This diff also involves recursive stubbing and un-stubbing of functions.

Test Plan:
- Run the pjs output tests
- Also put this in live editor, see "Sending true" and no errors in CDT
```
Program.runTest(function() {
             if (7 === 7) {
                 println("Sending true");
                 return true;
             } else {
                 println("Sending false");
                 return false;
             }
          });

var x = random(5);

Program.assertEqual(2, 2);

Program.runTest("Checks 2 = 2", function() {
    return 2 === 2;
});

mouseClicked = function() {
    Program.restart();
};
```

Reviewers: john

Reviewed By: john

Subscribers: #cs

Differential Revision: http://phabricator.khanacademy.org/D13054