Support registering admin hooks through decorators

Fixes the TODO note left in the code.

The change is backwards compatible with the function-style registrations. The tests have been updated such that one uses the decorator, and one continues to use the function style.