Sort attached functions (case-sensitive).
Attach functions needed for recovery.
Add recovery/verification of compact signatures.

Original concept at https://github.com/bitcoin/bitcoin/pull/524.
Python proof-of-concept at http://pastebin.com/bQtdDzHx.
cleanup, rename and fix memory leak on new Bitcoin::OpenSSL_EC.recover_public_key_from_signature method.