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.
I'm not completely sure that it belongs to x509_name (it simply reverses the url if name is url otherwise returns array with whole thing, so it fits both places) :) but sure I can move it.