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.