Add base58check enc/dec and use it for contract API input

* Add base58check enc/dec functions and proper test for them,
  excluding correct handling of leading zero bytes / "1" chars
* Use base58check in JSON API input validation
Merge branch 'gustav/base58check'

* gustav/base58check:
  Add base58check enc/dec and use it for contract API input