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.