Adds a regression test for issue #35.  This was tricky to get right, but will be useful in the future as a template for tests for build_ext.  This also involved reorganizing setup_helpers so that it will be easier to reset its module global variables between tests.
Merge branch 'issue-35'