Refactor code to allow for a consistent internal API.

CiviCRM's pre and post hooks are incredibly inconsistent, both in when they
fire and what parameters/objects are included in the hook. These changes
add a bunch of logic to add internal hook functions that are consistent and
give us the data we need to easily do mailchimp syncing.
In progress commit.