A simple stream transformer that allows registering of keyed or global handlers