[TASK] Cleanup ext:func

- Remove require_once calls
- Replace global $LANG and $BACK_PATH

Change-Id: I279bf7a1a59ed3dbf490a6b875977915ef503d13
Resolves: #49989
Releases: 6.2
Reviewed-on: https://review.typo3.org/22268
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
Reviewed-by: Stefan Neufeind
Tested-by: Stefan Neufeind