First step towards automating releases (T663). This eliminates manually fetching chainparams from a node. This diff is based on D3193, but distills fetch-chainparams down to a single task (DOTADIW, see https://en.wikipedia.org/wiki/Unix_philosophy).
Prerequisite: You must have bitcoind running with --rest=1 set either as a CLI arg or in the config.
In the near future, we will have a dedicated node that can have these requests directed to (at that point,
the hostaddr default will change from localhost to that dedicated node).
Typical usage during a release is to fetch mainnet params (fetch-chainparams.py with no args set).
Occassionally, testnet params need to be fetched as well, and may be done with fetch-chainparams.py -t.
Both of these uses assume default node settings regarding rpcport, rpcusername, rpcpassword, etc.
fetch-chainparams.py returns JSON-formatted blockhash and chainwork in stdout. In the near future, it may be piped
to other scripts that enable automatic updating of the chainparams, smoke testing, etc.