Make header processing a library function.
Make queue file handling, part of the import process.  Also correct a bug in Expiry date validation.
Remove obsolete function