Fix relative imports and remove circular dependency.