Restore implementation for auto register hooks.
Merge pull request #9 from jocelyn/auto_hook_20141112

Restored implementation for auto register hooks.