fix Script#cast_to_bignum on x86 32bit ruby

  32bit: -2147483647.is_a?(Fixnum) => false
  64bit: -2147483647.is_a?(Fixnum) => true

  32bit: -2147483647.is_a?(Numeric) => true
  64bit: -2147483647.is_a?(Numeric) => true
add Script#cast_to_string

  fixes:

    tx      = Bitcoin::Protocol::Tx.from_json(File.read('61a078472543e9de9247446076320499c108b52307d8d0fafbe53b5c4e32acc4.json'))
    prev_tx = Bitcoin::Protocol::Tx.from_json(File.read('5342c96b946ea2c5e497de5dbf7762021f94aba2c8222c17ed28492fdbb4a6d9.json'))
    tx.verify_input_signature(0, prev_tx) == true
optional flag to not throw an exception on Block.from_hash(h) in tests

  we can do stuff like this in tests now:

    h['tx'][1]['in'].first['scriptSig'][0] = '1' # break signature
    b = Bitcoin::P::Block.from_hash(h, false)
    b.recalc_mrkl_root and b.recalc_block_hash
    Bitcoin::P::Block.from_hash(b.to_hash)
fix non-standard OP_CHECKMULTISIG
switch over to parse_data_from_io and remove old string parsing methods

  keep it downward compatible though..
remove ppcoin parsing and serialization support

  calling Bitcoin#network_project takes 2% time when parsing 200 blocks just for ppcoins protocol changes. i don't like it and want those 2% back ;)
minor payload generation speedups

  but remember that `a << b` changes `a`. use `"" << a << b` if you need `a` again.

    require "benchmark"
    t = 100_000
    Benchmark.bmbm do |x|
      x.report("join"){ t.times{ a, b, c, d, e, f = "A","B","C","D","E","F"; [a, b, c, d, e, f].join } }
      x.report("<<"){   t.times{ a, b, c, d, e, f = "A","B","C","D","E","F"; a << b << c << d << e << f } }
      x.report("+"){    t.times{ a, b, c, d, e, f = "A","B","C","D","E","F"; a + b + c + d + e + f } }
      x.report("+="){   t.times{ a, b, c, d, e, f = "A","B","C","D","E","F"; a += b += c += d += e += f } }
    end

    # =>

    Rehearsal ----------------------------------------
    join   0.360000   0.000000   0.360000 (  0.353145)
    <<     0.160000   0.000000   0.160000 (  0.163171)
    +      0.170000   0.000000   0.170000 (  0.170922)
    +=     0.160000   0.000000   0.160000 (  0.157429)
    ------------------------------- total: 0.850000sec

               user     system      total        real
    join   0.150000   0.000000   0.150000 (  0.156188)
    <<     0.100000   0.000000   0.100000 (  0.107309)
    +      0.130000   0.000000   0.130000 (  0.130465)
    +=     0.140000   0.000000   0.140000 (  0.134390)
speedup Script#binary_from_string and Script#to_string

  perftools.rb graphs showed that 48% of the time during parsing/serialization roundtime was spent in Script#binary_from_string

  improving Script#binary_from_string resulted in faster code and only 8.5% time in that method. but showed that now to_string spent 25% in Script#to_string

  improving Script#to_string resulted in faster code and only 8.6% time in that method.

  finishing with this new spent time distribution:

    13.3%  Bitcoin::Script#parse
    13.3%  JSON::Ext::Generator::State#generate
     9.5%  Class#binary_from_string
     8.6%  Bitcoin::Script#to_string
     5.6%  Module#pack_var_int
     5.5%  Digest::Instance#digest
     4.2%  Digest::SHA256.digest
     3.5%  Bitcoin::Util#bitcoin_hash

   http://l.uphnix.de/bitcoin-ruby__parsing_tests__git_tree_fb7ad4368436313292899e0b12f5f006ede7a1ac.svg
fix p2sh with non-standard OP_CHECKMULTISIG from testnet3

  found in testnet3 tx: d3d77d63709e47d9ef58f0b557800115a6b676c6a423012fbb96f45d8fcef830

  two changes along with that fix:
    - change how sign_input_signature takes an optional forced script: binary instead of string format now. (faster, less conversion)
    - drop signatures before passing to sign_input_signature. dropping them inside there still works for backward_compatibility though.
remove BIP_0017: OP_CHECKHASHVERIFY
fix p2sh with non-standard OP_CHECKSIG from testnet3

  yikes, i fixed OP_CHECKMULTISIG but got OP_CHECKSIG wrong on the inner script refactor .. sorry.
speedup Validation::Tx#total_in and total_out
add coinbase_maturity and retarget_interval in the network config
allow to set Block#bip34_block_height aswell
add Tx#is_coinbase?
allow Script#to_pubkey_script_sig without pubkey (for pay-to-pubkey and pay-to-pubkey-hash)

  todo: maybe rename it because its name is wrong and confusing
add hashing opcodes test script
rescue script parsing but still survive serialization roundtrips

  tx ebc9fa1196a59e192352d76c0f6e73167046b9d37b8302b6bb6968dfd279b767 has hand crafted bad op_pushdata's which are but never run by bitcoind until someone tries to redeem them. for serialization its a different story and we need them to survive serialization roundtrips in order to generate the exact right payload from a tx in json format again.
option to skip validation in the node/storage
simple utxo-based storage backend, fix dummy backend