Import with top-level flag

Carry the flag through into the db from the yaml files.

Also PEP8 and the removal of a function which wasn't used and referenced non-existent classes and variables.