Refactoring TurboGears hooks and expose a public API to manage custom hooks