Restored write_if_different per https://github.com/astropy/astropy-helpers/pull/110#issuecomment-66697634 (I thought it was unused since it is not used within astropy_helpers, but it is being used externally.  However, tehre were actually two copies of this function in astropy_helpers, somehow.  One in setup_helpers and one in utils.  I have added it back to utils but also included it in setup_helpers via import.
Add new find_packages that caches its results--we'll need to do a find_packages and loop over all the setup_package modules twice in order to pick up pre-/post-command hooks.
add cython_version.py to .gitignore
Update the reworked find_packages to use the setup_helper's _module_state dict for the package cache rather than a normal global variable, so that it can be easily reset at the end of test runs--this was causing some tests to fail depending on the order in which they were run.
Probably not necessary, but just to be on the safe side ensure that this test restores its previous cwd.
Add support for pre- and post-command hooks that can be provided by
setup_package modules (along with the other get_ functions they can
provide.

The hooks should be variables in the setup_package module with names
like pre_<command_name>_hook.  For example to implement a pre-build_ext
hook there should be a pre_build_ext_hook defined in setup_package.
Every setup_package module can provide hooks, though their run order
should not be relied in.  In other words, there is no way currently
to ensure that hooks defined for the same command are run in a specific
order.  One can also define a post_<command_name>_hook.

This also adds an optional srcdir option to register_commands so that it
can be passed through to the find_packages call that register_commands
now makes.