Refactor handling of Drupal hooks where profile installer has to detect and invoke them.