Infinite Scroll: Make sure it's an XHR before setting DOING_AJAX early.
- Check the X_REQUESTED_WITH request header.
- Fall back to setting the constant in the response function if it's not already.
- Improve commenting