Auto-importer improvements

This adds an archive option as requested by @pwalczysko but also fixes some bugs and make path handling a little more general.