Re-add Hooks

The changes in some files wasn't made by me.
I just copied it from the "develop" branch of CodeIgniter.