Phase 3 global merge

I merged all phase 3 code into this branch.

The only missing part is the scanning progress bar: it doesn't update during the scan. I takes some time to do this properly and I think it isn't a priority (our blockchain is very small).