Clean up DSA code and add more tests

Signed-off-by: Daniel Thomas <drt24@cam.ac.uk>
Log exceptions in DatabaseNigoriProtocol which we are not propagating as on the boundary of a trust domain

Signed-off-by: Daniel Thomas <drt24@cam.ac.uk>