Added feature to defer writing the bag when adding a file.

This causes the bag info file not to be written every time a file is
added. The caller still needs to call `write_bag_info`, but it can now
be done once instead of on a file-by-file basis.
Added functions to quickly create hashes for a file.

This does all the files at once, only one hash algorithm at a time, and
keeping the manifest file open until all the processing is done.