Add repeat to QueryInterpreter and change Repeat to SqlFunction to avoid...

... special implementation

@mobiworx This makes the unit tests pass and slightly improves the implementation. I suggest you merge it and then squash it into your commit. Also I would suggest that you retarget your PR against the 2.1-no-bin-compat branch. That way it will end up in 2.1.1 soon and not only in 2.2 at the end of the year. This retargeting probably involves cherry picking your commit on top of 2.1-no-bin-compat.