Mardak/profile — pull request #19 by mzhilyaev (2014-01-30 19:37:53+00:00)
Title: Collect and dispatch NYT user data

Collection of NYT user data proceeds as follows:
- Controller processes history on start-up and idle-daily events
- Before calling to resubmit history, the controller will execute _fetchOnSubmit() call
- This call is suppose to pre-fetch needed info in the background
- In particular, NYTUtils.fetchNYTUserData() will be called by _fetchOnSubmit()
- NYTUtils.fetchNYTUserData will issue an XHR request to nytimes.com to collect user info
- when the response arrives, it gets timestamped and augmented with article-visit count from "nyt-m" cookie
- the resulting object is cached in storage
- when dispatcher makes a payload object it collects NYT user data from NYTUtils.getNYTUserData() and attaches it to the payload.