Refactored database code into separate file.
Replaces gosqlite with gorp.
Added ExtKeyUsageEmailProtection to marshaling code.