Initial implementation of pgp

Still needs testing because I don't have the DB backend on this computer. Happy to discuss any bug smashing that needs to happen if this doesn't run.