Move MiniTest detection methods into their own module.

I want to use this logic elsewhere.
Reduce duplication in MiniTest version detection.