#478 Fixed undefined constant error by defining constant earlier.
#478 Reverted to using simplesaml redirect method to prevent endless redirect
Merge pull request #493 from janus-ssp/feature/478-fix-undefined-IS_AJAX-constant

[REVIEW] Feature/478 fix undefined is ajax constant