Reorganised imports

Swapped the order of the imports so that flake8 will see that they are
correct, and changed the test import to be relative rather than absolute,
as is the standard