Fix unconfirmed balance bug due to orphans/conflicts
Minor cleanup; add tests
Merge pull request #134 from aalness/0conf_balance_fix

Fix unconfirmed balance bug due to orphans/conflicts