Split applyHistory into applyHistoryFromBlock
Split applyHistory into applyHistoryFromBlock

Following #2456, this further refactors the Wallet.applyHistory function by
splitting the body of the giant loop it contains into a separate method.

This reduces the 176 LOC method to 170 LOC and reduces the control flow
nesting depth by 1.

mharkus/Sia,mharkus/Sia,mtlynch/Sia,NebulousLabs/Sia,mtlynch/Sia,NebulousLabs/Sia