Remove usage of tempfile.mkstemp because it was too easy to leave open file handles laying around.
Use binary mode for streaming files to and from the repo.
Patch conversion to and from Unix epoch timestamps.