Added new memory.hooks module with PreHook and PostHook decorators.