Add importlib to requirements.txt and a couple of other test tidy-ups