Tiled Gallery: Fix image meta encoding.

Image meta is now encoded by calling `esc_attr` on the result of mapping strval over the image meta attributes, instead of mapping `esc_attr`. This way `json_encode` can properly escape any quotes inside the attribute, before being attr encoded.
Carousel: Add and use an in_gallery variable
set by a low-priority post_gallery hook

Props @chrisbliss18
Carousel: fix check if we're in a gallery
Sharedaddy: only enqueue Javascript when Shares are displayed

Check our sharing options: if the sharing buttons are set to appear on that page, we enqueue the js
Sharedaddy: move check if sharing is enabled to its own function
Sharedaddy: only enqueue CSS if the buttons should be displayed
Sharedaddy: always enqueue scripts on themes supporting IS
Sharedaddy: align statements
Sharedaddy: add filter to change when files are enqueued
Sharedaddy: only enqueue files when IS is active
Sharedaddy: remove IS from conditional

IS already takes care of enqueuing resources if needed
Sharedaddy: change $global into $global_options

To avoid any confusion with GLOBALS
Fix whitespace in test comments

Obviously, I am still getting the hang of sticking to the style
you folks are using. This commit fixes some misaligned comments
in the test_class.functions.compat.php file.
Merge pull request #987 from enkrates/fix-whitespace-in-tests

Fix whitespace in test comments
Merge pull request #954 from jeherve/fix/likes-enqueues

Sharing: only enqueue styles and scripts when necessary
Merge pull request #101 from jeherve/1655-trac

Carousel: logical issue in wp_get_attachment_link filter
Inline Styles: Preserve the status quo.

Make sure that if there is any inline_style already there from a
separate `wp_add_inline_style()` call, that the css we’re inlining goes
at the front.  It can prevent glitches where the inline css no longer
overrides the content as it would have been before sequentially.
With RTL Replace assets, don't inline LTR
Extract and use the href from the tag.

This will make sure we’re using the rtl version for rtl, as well as
respecting the filtered tag from any other plugin.
Remove leftover bit from previous Network CSS removal. Fixes Automattic/Jetpack#992