Add hook_civicrm_preProcess function.

This seems to be a generically useful spot to intercept the form object and
change things before the form is processed. Specifically, we need this hook
for integrating the Event Cart with the CiviDiscount extension.
Porting over of this patch from another Civi instance failed miserably.

This commit includes the full preProcess hook definition and fixes the syntax
error.
Update the hook invoke method to follow the CiviCRM 4.5 conventions for
invoke.
Merge pull request #4552 from giant-rabbit/preprocess-hook

Add hook_civicrm_preProcess function.