Javascript wrappers for inserting before and after calls around a function, while preserving as much identity of the wrapped function as possible.