Add compatibility for 3.2 and 3.3.

Use imp.reload() if importlib.reload() does not exist. Use mock if
unittest.mock does not exist.