Restructure signing code

All sorts of signatures can be verified now, and it is easier to extract
information from the verified signature packets.