Work in progress on adding duplex processing support.
More hacking on mergescans. Created a new FileToUpload struct which simplifies
cleanup of tmp directories.
More bug fixes. Frustrated to learn that it's near impossible to know when a
file is finished being uploaded due to scanning delays.
More fixes.

More scanner testing convinced me that there won't be long delays with no
modifications to an incomplete file, so I shortened that timeout from
2 minutes to 10 seconds. Far more reasonable.:w

Also, implemented the TODO where if we see a X-page duplex document followed
by a Y-page duplex document, where X !=Y, instead of treating both as monoplex,
we treat the first as monoplex and the second as the first side of a duplex
document.