New faster and more flexible implementation.

The v1 implementation was using a rather naive flat list of absolute event handlers internally which had two problems:
- it could not allow global events handlers that would be picked up regardless of the current parsing depth.
- it had a few calls to the strings package which made it slower that it should have been.

This new implementation is based on a dynamic handler tree which fixes the above two problems.