Use regular hooking code for wrap action

This has several advantages
- Familiar, unified syntax
- Filename parameter can actually be used
- Not limited to bare functions; call class methods

Signed-off-by: John Rayes <live627@gmail.com>
Merge pull request #1703 from live627/th

Use regular hooking code for wrap action