Add test case to work on bug where encrypted email does not look signed; some refactoring