Updates for MiniTest version >= 4.6.0

`add_setup_hook` was removed in 4.6.0:
https://github.com/seattlerb/minitest/commit/792a480ebeb32983b9150adae575b7c396e2ae63

It looks like the before and after logic can be shared between the
MiniTest and TestUnit adapters, so I refactored them into a shared
module.

All of the tests pass when I run `rake ci`