Move pjax initialization inside of document.ready
Use built-in Slim function to check X-PJAX header for better reliability with case sensitivity