Move jQuery setup for ajax/csrf outside of document.ready handler.