Added option to cache query results

Added caching option for query results and fixed Settings#getAjax(true)
re-creating the AjaxSettings object even if the object has already been
created