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.
It is a little odd to have the database be the authority on ASN.1 parsing - I don't think this really belongs in the storage layer. I think you'll also find that you'll be duplicating this code in every implementation of the database now (should there ever be other implementations).