Refactor hooks to precompute handlers to call

When a hierarchical event is emitted, we first do a
lookup to figure out *all* the handlers we need to call
(and in the proper order), then we go about actually calling
the handlers.

We can use this same approach for wildcard events.  One functional
change here is that the event name is kept the same for each
level of the hierarchy.  I think this makes more sense than the
original approach.  So for example, if I emit 'foo.bar.baz', I'd
actually emit 3 events: 'foo.bar.baz', 'foo.bar', 'foo'.  Now,
we calculate the handlers for each of those three events, but logically
we're emitting an event 'foo.bar.baz'.   The tests have been updated
to reflect this.
Add naive version of wildcard events

Haven't tested performance, but all the tests are passing.
Will look into optimizations next.
Add simple caching to event lookups
Use a prefix trie to store event handler registrations

The previous naive implementation was really slow and
inefficient.  Using a prefix trie (specialized to also
support wildcard matches), the benchmarks come back much
much faster.

The only thing that's not 100% is deletes.  If a leaf node has no
associated values with it, it should be deleted from the parent node.
This makes lookups in the case where they key is not in the trie
faster.
Optimize deletes from prefix trie

We we recurse up, if the node has no children/values
we can remove its link from the parent node.  This makes
subsequent lookups faster in the case where they key does
not exist.
Use HierarchicalEmitter in Session object