Add first and last aggregate functions

These can be used for JSON data, since JSON do not have any equality
operator, and thus cannot be used in group by's or via the MAX(json)
trick.
Fix broken postnumre tests