Bug/02 open wallet

- refactor original PR from @cmgustavo https://github.com/bitpay/copay/pull/1066
- add tests