Refactored code to use Environment and Input in static way

This will set contao 3 compatibility ... but is not backward compatible

Also added legend translation for page configuration fieldset.