bitcoind style sign/verify nicer handling of errors and added tests for errors