bitcoin-tx: Accept input via stdin. Add input handling to tests.