More work on disentangling imports. Start flake8'ing functional tests.