[FEATURE] Backport ApplicationContext from Flow

Flow has the notion of ApplicationContext which provides a unique
API for handling contexts.

This API allow us to provide default configuration sets for
particular contexts. For example having decent logging in
production context vs. full reports in development context.

The context is set using the TYPO3_CONTEXT environment variable.
If not set the context defaults to "Production".

The context can be queried using:
\TYPO3\CMS\Core\Core\Bootstrap::getInstance()->getContext();

Resolves: #49988
Releases: 6.2
Change-Id: Id953052f2846c740f27a83931adfb64b0d8d9169
Reviewed-on: https://review.typo3.org/22269
Reviewed-by: Thomas Maroschik
Reviewed-by: Stefan Neufeind
Tested-by: Stefan Neufeind