Clean up hooks; #135, #136

This adds hooks for inbound_core, error_early, and error_late, and
folds the outbound_early and outbound_late hooks together into a single
outbound hook.