Update setuptools setup.py to work with setuptools 4.0
Added tag 4.0b1 for changeset 78c8cfbe3e10
Sort entry points when writing so they render consistently
Use binary mode to save/restore entry_points - no need to mutate newlines
Use a context manager instead of calling _test.run in multiple places. Alleviates need to warn about Exceptions