REST API: Add 'plugin' type to cast_and_filter_item.

Used to cast and filter the result of the list plugins endpoint.
+ Add 'safehtml' type applies wp_kses to the response value. Used to sanitize the plugin description.

Merges r101961-wpcom.
REST API: Add 'jetpackmodule' type.

Used to safe cast the module description.

Merges r102179-wpcom.
REST API: Fix empty categories when slug doesn't match name

Since we've already found the category by ID there's no need to search it by slug again, specially when the slug doesn't match what's in the database.

See: http://[private link]

Merges r102318-wpcom.
JSON API: Make sure datetimes are always well formed.

WordPress stores `date` and `date_gmt` fields for posts (same for `modified` and `modified_gmt`).

The API's date formatting code uses both of these values to generate a datetimestring including the local time and a timezone offset for that post.

For drafts, though, date_gmt is set to "0000-00-00 00:00:00", which is messing up the API's date formatting code.

Dates were being output like: "2014-02-14T09:21:51+17656209:21".

When the gmt field is missing like that, use the blog's timezone/offset option to calculate the correct offsite time.

http://[private link]

Merges r102805-wpcom.
JSON API: Fix processing of boolean inputs.

To specify boolean inputs, you had to specify `foo=true` or `foo=false`.

You can now also specify `foo=1`, `foo=0`, `foo=t`, `foo=f`, etc. as intended.

http://[private link]#comment-1722

Merges r102851-wpcom.
REST API: Properly load categories & tags for private blogs.

Added a test that uses the contributor auth token to test with limited permissions.

https://[private link]
https://[private link]#comment-1524

Merges r103317-wpcom.
JSON API: Boolean args in `::cast_and_filter()` should respect the `$return_default_values` parameter.

Broken in [102851].  Discovered in [103238].

For example, `bin/api/test.php --test invalid_update_post_request_should_400`

Merges r103321-wpcom.
JSON API: Make sure comment author fields do not get HTML encoded.

http://[private link]

[103319] is similar for post fields.

Merges r103324-wpcom.
Merge commit '75370c9' into merge-george-08222014

Conflicts:
	class.json-api-endpoints.php
REST API: add post thumbnail image object as part of the post response

see https://[private link]

Merges r101978-wpcom.
REST API: post_thumbnail should be null instead of an empty string when it's empty

see https://[private link]#comment-1657

Merges r102297-wpcom.
JSON API: Parse numeric inputs for categories and tags as IDs, as we claim we do in the documentation.

These should all work now (where `7202` is the ID for the "foo" category).

{{{
curl ... --data-binary '{ "title": "testcat1", "categories": [ 7202, "bar" ] }

curl ... --data-binary '{ "title": "testcat2", "categories": [ "7202", "bar" ] }

curl ... --data-binary '{ "title": "testcat3", "categories": "7202,bar" }

curl ... --data 'title=testcat4' --data 'categories[]=7202' --data 'categories[]=bar'

curl ... --data 'title=testcat5' --data 'categories=7202,bar'
}}}

http://[private link]

Merges r102802-wpcom.
REST API: Update documentation for sticky post flag to match other bools.

Merges r103238-wpcom.
Merge commit '97ebca2' into merge-george-08222014

Conflicts:
	json-endpoints.php
JSON API: Make sure comment author fields do not get HTML encoded.

http://[private link]

[103319] is similar for post fields.

Merges r103324-wpcom.
REST API: allow contributors to access the site endpoint's `options` object

None of the information contained in the options object is sensitive, so let's make it available for contributors. This is one of the steps in making the Interim Editor work for contributors.

see https://[private link]

Merges r102694-wpcom.
JSON API: Flag to sort comments hierarchically.

Documented as in "beta" for now.

http://[private link]

Merges r102855-wpcom.
REST API
Media / Featured Image

We were waiting on a systems fix for uploading from rest api (since only admin webs support uploading).
Should be fixed as of https://[private link]#comment-29179 - tests succesfully ran against production

also fixed a small logic check. we still want to call the function if featured image is empty (if its specifically set empty) because otherwise the delete, pass as blank functionality doesn't work.

Merges r102598-wpcom.
JSON API: Parse numeric inputs for categories and tags as IDs, as we claim we do in the documentation.

These should all work now (where `7202` is the ID for the "foo" category).

{{{
curl ... --data-binary '{ "title": "testcat1", "categories": [ 7202, "bar" ] }

curl ... --data-binary '{ "title": "testcat2", "categories": [ "7202", "bar" ] }

curl ... --data-binary '{ "title": "testcat3", "categories": "7202,bar" }

curl ... --data 'title=testcat4' --data 'categories[]=7202' --data 'categories[]=bar'

curl ... --data 'title=testcat5' --data 'categories=7202,bar'
}}}

http://[private link]

Merges r102802-wpcom.
REST API: Update endpoint to create posts to correctly set non-GMT date
See: http://[private link]

Merges r103419-wpcom.