Adding some sqlite aggregate helpers.