Tests: Modify finalize file with new X-File-Length header

Modify tests and helper functions that finalize a file to use the header X-File-Length for the file size.

This depends on #129