[electrum] add tests for command line preprocessing
Summary: Refactor command line preprocessing to make it testable.
Test Plan: python test_runner.py
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Differential Revision: https://reviews.bitcoinabc.org/D14382