Added isAjaxRequest method and set JSON headers for AJAX requests
added debug mode var
Added caching for templates, on debug mode, force compile
Revert "Added caching for templates, on debug mode, force compile"

This reverts commit 25308bbc16ff61d921c1d2e71396d4a2c7820b93.
Revert "Revert "Added caching for templates, on debug mode, force compile""

This reverts commit 4778a3755c12736a05f361f940ebf9b215873318.
Revert "Revert "Revert "Added caching for templates, on debug mode, force compile"""

This reverts commit 718d025d13a2af1857d0fa7a3b4070e94047f2ea.