Handle functions as the value of a hooks.<name> config variable
This should make it easier for extensions to add a hook when
they're loaded.
setup.py: reload __version__.py after writing it.
write_version loads __version__.py before writing it (see
7eb694a1c1af),
so we have to explicitly reload it to use the correct version.
Problem diagnosed by Christian Ebert.