Refactor hooks.rb.
Refactor hooks.rb.

Hopefully this actually brings it into line with how things are supposed
to be done. Guess I should actually try learning Ruby before I try
writing plugins for something? :)

jmcb/update-custom-fields-commit