Refactor navigation event handling.

*   Introduce new events and request callbacks to more consistently provide
    parity between the two.
*   Use dedicated functions to dispatch events and callbacks to ensure the
    custom event detail objects and callback arguments are identical.
*   Add events for handling clicks and history changes, allowing them to be
    canceled to prevent navigation.
*   Deprecate the old events and callbacks.
*   Update the demo app to use the new events.

Progress on #12.
Might as well just inline this. Extend the comment on line 811 if you want to retain that.