Move package import to lib/import.php. Create new import_package.php CLI script. Make output logging an import function.