infinity.js : Resolve Divergence from Jetpack

This patch teaches the infinite scroll system how to pull DOM nodes out of
nodes outside the current viewport and stash them in a cache. It does this
by hooking into determineURL and walking all of the pages that were determined
to be hidden. It pulls all of the child nodes out of the page and stashes them
in a DocumentFragment. It also updates the min-height of the page wrapper to
match the old height when all the children were present.

When a user scrolls a page back into view, the children are reinserted into
the wrapper and the min-height and class marker are removed.

See https://github.com/Automattic/jetpack/pull/300

But also fixes : https://[private link]

The cache that was stored did not work with lazy load or any other plugin that fires on the 'post-load' event.
Since the post load wasn't fired every time the content was added or re-added to the dom.
Now we store the html also right before we take it away because it might have been altered by the post-load event.

Another  optimization that was done to fire the change url  in the same timer as the the refresh() since this will only create one times instead of multiple once.

Merges r106807-wpcom.
infinity.js : Resolve Divergence from Jetpack

This patch teaches the infinite scroll system how to pull DOM nodes out of
nodes outside the current viewport and stash them in a cache. It does this
by hooking into determineURL and walking all of the pages that were determined
to be hidden. It pulls all of the child nodes out of the page and stashes them
in a DocumentFragment. It also updates the min-height of the page wrapper to
match the old height when all the children were present.

When a user scrolls a page back into view, the children are reinserted into
the wrapper and the min-height and class marker are removed.

See https://github.com/Automattic/jetpack/pull/300

But also fixes : https://[private link]

The cache that was stored did not work with lazy load or any other plugin that fires on the 'post-load' event.
Since the post load wasn't fired every time the content was added or re-added to the dom.
Now we store the html also right before we take it away because it might have been altered by the post-load event.

Another  optimization that was done to fire the change url  in the same timer as the the refresh() since this will only create one times instead of multiple once.

Merges r106807-wpcom.
The cache stores now the whole response, and overwrites the html before we remove it from the DOM.
We also fire the 'post-load' event so that other plugins can hook into the event. And modify the dom.

Another  optimization that was done to fire the change url  in the same timer as the the refresh() since this will only create one times instead of multiple once.
Merge commit 'c467e74'

Conflicts:
	modules/infinite-scroll/infinity.js
REST API: Add StatsD timing tracking on a per API method basis

Merges r106595-wpcom.
Rest API: Rename StatsD stat names to make it clearer which methods failed.

Merges r106597-wpcom.
JSON API: Don't output /help for `__do_not_document` endpoints.

https://[private link]

Merges r106605-wpcom.
JSON API: Revert r106605, it broke everything.

Merges r106606-wpcom.
JSON API: Move timing collection down so that we can also capture each part of batched calls.

Merges r106721-wpcom.
REST API: Fix upload media endpoint example to use correct media[] request parameter

Merges r106618-wpcom.
Business: Google Analytics: REST API endpoint

See:
 * https://[private link]#comment-26137
 * https://github.com/Automattic/calypso-pre-oss/pull/1103

Merges r106751-wpcom.
Google+ Authorship

Continued from [106789] and [106788], remove the G+ flag from the API. It no longer serves any function (if the request still passes it, thats fine).
See https://github.com/Automattic/io/issues/25

Merges r106790-wpcom.
Merge commit '9fb7b22'
Tiled Galleries: Merged changes from Jetpack for tiled and widget galleries

Reorganizes Tiled Galleries code while keeping the functionality the same. Components are separated into files to make the structure more clear. Complicated loop and string concatenation logic for HTML generation was refactored to use a template-like approach. This keeps the separation of presentation logic and the layout computation more distinct.

Updated the async-jobs/jobs.php to make sure that we keep the stats count of tiled galleries.
Also made fixed to fatal error found in https://[private link]

Some changes were introduced to Widget Galleries to use the new layout objects instead of the previously used layout functions.

See https://[private link] for some discussion.

Relevant commits Jetpack commits go back to Apr 18, 2014
https://github.com/Automattic/jetpack/commits/master/modules/tiled-gallery/

Merges r106726-wpcom.
Tiled Galleries: Fixes bug introduced into reader
wpcom_enhanced_excerpt_extract_excerpt() - converts new lines into paragraphs.

Since we introduced new lines html attributes markup would show up as paragraphs
in the reader.

Related https://[private link]

Merges r106782-wpcom.
Removing whote space and
Merge commit '31673fd'

Conflicts:
	modules/tiled-gallery/tiled-gallery.php
Tiled Galleries: Merged changes from Jetpack for tiled and widget galleries

Reorganizes Tiled Galleries code while keeping the functionality the same. Components are separated into files to make the structure more clear. Complicated loop and string concatenation logic for HTML generation was refactored to use a template-like approach. This keeps the separation of presentation logic and the layout computation more distinct.

Updated the async-jobs/jobs.php to make sure that we keep the stats count of tiled galleries.
Also made fixed to fatal error found in https://[private link]

Some changes were introduced to Widget Galleries to use the new layout objects instead of the previously used layout functions.

See https://[private link] for some discussion.

Relevant commits Jetpack commits go back to Apr 18, 2014
https://github.com/Automattic/jetpack/commits/master/modules/tiled-gallery/

Merges r106726-wpcom.
White space and
Merge commit '42f3d35'

Conflicts:
	modules/widgets/gallery.php
Widget Top Posts: Resolve divergence from Jetpack
When choosing the "Image Grid" option in the Top Posts & Pages widget, the thumbnails are not clickable. This change fixes that.
https://github.com/Automattic/jetpack/commit/5bef32c009f8afed90bdd3bcd6e07deee3c1084c

Merges r106413-wpcom.
-- Merge commit 'c5029e4'

Conflicts:
	modules/widgets/top-posts.php
WPCOM: Shortcode: Update the bandcamp shortcode to support videos

Merges r106793-wpcom.