Small refactors and new test

I started doing https://github.com/bitpay/copay/issues/1113 and I realized changing the whole way settings are handled would be unsafe without a proper wallet import test. This PR adds that test (took me a long time to get it working, unfortunately)

ready for review
I didn't change those lines, really. Can we change it in another PR? :3