Ensure list of previous dirs is correct

in _migrate_directory_structure() - before there was a risk we'd end up
with a directory of '' if the ls output ended with \n due to how split()
works.

Also, doing strip('\n') after split('\n') is redundant, so removed it.
some minor bits of clean up