A bunch of import-related fixes that were necessary to get command-line import working.

Still doesn't address the larger resource finding issues we need to thing about.