Moved actual import checking logic to sympy/utilities/tests/diagnose_imports.

bin/diagnose_imports and the unit test just run this file for their respective tasks.