Add crypto and database interface + tests.

Most of the crypto interface and read, write for the git interface is
implemented.