Add support for match-v2.2 and matchhistory-v2.2

Also introduces a bunch of bugfixes concerning rest