Add (optional) BIP62 rule checks

This implements rules 1 through 6 from BIP62, as a pre-requisite for BIP62 support in Toshi. These checks are all optional and are only performed when relevant options are specified in the call to verify_input_signature().

It should, yes. Cut & paste error while writing it. Certainly can structure more closely to the original if you'd prefer?