remove unused imports, standardise import order, etc

Perhaps unused import?

@bryevdv, can we use `# XXX: ` prefix for this kind of comments. It's useful if you have a properly configured editor (applies also to `# NOTE: `, `# TODO: `, etc.).