simplify code for writing of initial headers

--HG--
extra : rebase_source : 4d0bcc6619586b5324c63b8e339f857f7aa78257
lazy reading of manifest data

--HG--
extra : rebase_source : b792b15bf254514d284e16934fd9aa37dabb0d55
factor out SizedFile class