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.