[BUGFIX] Fix "undefined" PhpStorm warnings

Fix most of the occurrences of undefined classes, namespaces, methods, fields
and variables, including instances of "might not be defined".

This change also deletes the unused JsonViewHelper (which calls inexistent
methods) and the ToolsTest (which does not include a single non-skipped test
and which also calls inexistent methods).

Change-Id: I879d4deafaf2b5d7e6312bacb5c7d2716f6975d4
Resolves: #58234
Releases: 6.2
Reviewed-on: https://review.typo3.org/29681
Reviewed-by: Nico de Haen
Tested-by: Nico de Haen