Work Queue Send File Cleanup

This pull does a general refactoring and cleanup of the work queue file sending logic, which was getting exceptionally deep and repetitive, and contained several memory leaks.

Two issues left for later:
1 - Cleanup of receiving files.
2 - Design question about the proper name for cached files.