Improve FileCacher

Split "get_file" and "put_file" (which had a very complex API) into many
simpler methods. Make LargeObject become a proper file-like object and
change the way it connects to the PostgreSQL database. Redefine some
interfaces, carefully specifying what types they expect (especially
bytes vs. unicode) and what exceptions they can raise. Add all missing
docstrings. Various small fixes and improvements.