Added ExtendChainWithAllMempool and general refactoring/comments