Implemented a metaclass-based technique for self-registering handlers

--HG--
extra : rebase_source : d301524fd9a0d799ea0344508e675ea9c93f170f