Surround node.js functions with pre and post hooks.