Changed cert_db to use Certificates and log_ids.

I think it's nicer if cert_db itself pulls subject names etc. from the certificate, so I changed it to use cert.Certificate. Also it should be more convenient if id in database were the same as certificate index in log.
This class should live in a module of its own (perhaps it's time for a ct.client.db package or ct.monitor.db package).
This way the db interface does not need to import ct.crypto.cert (and you achieve proper separation between the db and cert modules).