Fix our module import checks.

We have a number of checks to see if we can import certain modules. For
these, we use a combination of `import` statements and `imp.find_module`
calls. The reason is that some modules would fail to import on some
systems using `imp.find_module`.

The reason for that is that `imp.find_module` doesn't use registered
importers, and therefore can't find modules in zipped eggs. Furthermore,
our usage would cause leaked open file handles, since if the module is
represented by a .pyc file, `imp.find_module` would pre-import it.

Instead of dealing with all this, I've added a new, single function for
checking if modules can be imported. All checks in the codebase now use
this instead, giving us consistency and fixing the issues with zipped
eggs.

Reviewed at https://reviews.reviewboard.org/r/5846/