[refactor] Config handling refactoring in preparation for network-specific sections
Summary:
- Move ChainNameFromCommandLine into ArgsManager and rename to GetChainName
- [tests] Add unit tests for GetChainName
- Separate out ReadConfigStream from ReadConfigFile
- ReadConfigStream: assume the stream is good
- [tests] Add unit tests for ReadConfigStream
- [tests] Check GetChainName works with config entries
- [tests] Add additional unit tests for -nofoo edge cases
This is a backport of Core's PR12878
Depends on D1833
Test Plan:
make check
Reviewers: #bitcoin_abc, jasonbcox, schancel
Reviewed By: #bitcoin_abc, jasonbcox, schancel
Subscribers: schancel, jasonbcox, teamcity
Differential Revision: https://reviews.bitcoinabc.org/D1834