A slightly simpler, I think, implementation of get_distutils_option(). This does nothing to solve #142--the problem there is deep in the bowels of distutils' option parsing.  However, this implementation is a little more robust against letting distutisl_parse_command_line() have side effects.  It silences any stdout/stderr from it, prevents it from causing Python to exit, and only performs the option parsing once which seems preferable. This was specifically motivated by a problem where running 'setup.py build_ext --help-compiler' caused the compiler list to be printed every time this function was called.  Rather than make a special case this seemed like a more general long-term solution.
Reorganized the setup.py a bit to help see the forest through the trees a little better.  Leaves all the major pre-setup() steps in place for inspection, but moves more of the details to setup_helpers.py.  Also version_helper->version_helpers since the inconstency with 'setup_helpers' always bugged me.  Finally I should note that this change makes my patch in #142 redundant as well.
Reworked get_distutils_option() to use a get_dummy_distribution(); it seems there are cases where it could be useful to have access to the Distribution object. One such use which is also included here is reworking how build_ext is forced when the --debug option changes.  The previous hack which consisted of appending the sys.argv was fragile, and could cause bad behavior for example when running 'python setup.py' with no arguments (this could actually cause build_ext to be run!).  The new solution is also a bit hackish but involves fewer side-effects.  It wasn't available as an option before because we weren't subclassing build_ext. Now that we are subclassing build_ext it seems a better solution.  Temporarily disabled the forced rebuild when the Cython version changes until I come up with a better solution for that too.
Rewrote the add_build_option and add_install_option class methods as a more general add_command_option. The need for the custom AstropyBuild command falls away immediately; AstropyInstall is likely to fall as well with a bit more tweaking.  This did require removing the memoizing property of the get_dummy_distribution() function since the possibility of adding additional command options later in the setup process means the command-line options need to be re-parsed.  Profiling suggests this was a premature optimization anyways.
Reworks the Cython handling stuff in such a way that preserves all the use cases described in #594. All the work of regenerating the cython_version.py and forcing a rebuild when the Cython version has changed since the last build has been shoved off to the build_ext command where it truly belongs anyways, and the should_build_with_cython() function now has the same logic but is now a pure-ish predicate function and does not have any surprising side-effects.
Reworked the default config generation; now it occurs at the end of the build_ext command rather than in the build command.  This probably still needs some tweaking but I think it's on the right path, maybe?  Now we get an astropy.cfg in both the source and copied into the build/ dir.  Only problem I'm seeing so far the generation of an astropy.log file in the source. Need to fix that.
Modify save_config and related functions to allow an optional alternate file path to write the config file to rather than the default; this greatly simplifies matters for generating the default config file.  The only problem I have now is that the config file is *always* regenerated after running build_ext, even if no source files changed.  Another rare corner case where this won't work properly is if some config items have changed in pure Python modules and build_py is run directly this won't update the default config file--it only gets updated if build_ext is run.  I have a possible workaround for that in mind, but I think it can wait until and unless it's an issue.
Merge pull request #668 from iguananaut/setup-refactor

Refactor setup.py, setup_helpers.py, and fix various little issues therein