Issue begin and end events

When the scheduler begins or ends an animatio, we issue a begin event or
an end event.

If the animation was already running when we begin it
again, we issue an end event before the begin event.
These should be in a more standard testing format eg.
assert(e.view !== document.defaultView, 'The view is the document default view')
function assert(condition, message) {
    console.log((condition ? 'PASSED: ' : 'FAILED: ') + message);
}