Code review progress

- Fix subject key identifier encoding.
- Simplify extension functions.
- Simplify add_skid, suggestion by Stephen Henson.
- Fix reporting of bad digest errors.
- Cleanup chain construction logic.
- Set verification error on out of memory errors.
- More generic Makefile.
Add offline test program and initial test cases
Added imap.gmail.com certificate chain and root

Used in offline test cases for now.