[master] Migrate logs from older versions

Despite the fact that we can read older log versions at the runtime, this PR will add an extra step to the upgrade process which will be responsible to migrate older logs and order log entries. This is necessary because we must be able to read commit entries from the log files in the correct order. Indeed, entries can be mixed up in older log files but they _must_ be order by transaction id in 2.2.

Integration tests will be added in a separate PR, since it will require some kind of tool for "mixing up" entries in older log files.
We load everything in memory since it is easier to sort stuff when they are in memory. On the other hand I see your point, are you proposing to write down intermediate data on disk, sort them somehow and then rebuild the new log file?