Move bundle filename generation into AnnotatedBundleData.
Fix offset computation error in tree hash.
Add missing callback.
Implement upload state machine.