Unit tests and refactor

Working on adding unit tests and getting a good test coverage.

On the way, I'm trying to unify some duplicate code especially related to launching btcd/btcwallet and connecting rpc client.
Yeah, as mentioned, I'm not testing the exact value of these fields, just checking if they are not empty.