[TASK] Sync TYPO3 CMS Fluid with Flow Fluid 1.1 (part3)

This is the third part of a backport fluid from Flow.
It contains unit tests.

Change-Id: I9990607d95387b3635a2aaebfc49993f85be5bb7
Releases: 6.1
Resolves: #44819
Reviewed-on: https://review.typo3.org/18192
Reviewed-by: Marc Bastian Heinrichs
Tested-by: Marc Bastian Heinrichs