Moved code to avoid circular dependency.

The dependency already imported code which depended on third party
packages. During a buildout, that part would have failed miserably.