To/from buffer/hex

This ports the recent changes by @dcousens from bitcoinjs-lib back to bigi. See https://github.com/bitcoinjs/bitcoinjs-lib/pull/150 for relevant discussions.

__Update:__ I removed the number type assert as it uses `Number.isFinite` which is part of es6 (reads: limited browser support). The assertion also only covered the type checking but not negative numbers. In addition, I also renamed the argument name from `s` to `size` to avoid any unnecessary guessing.