Mojo: Add support for converting between mojo::String and base::StringPiece.

This CL also adds an implicit conversion operator to type U that works
just like an explicit call to To<U>. This is to go along with the implicit
conversion constructors on mojo::Array and generated class types. While
discouraged by the style guide, I think this kind of implicit conversion
will be very helpful at reducing code verbosity. It shouldn't be too
dangerous either.

Finally, I took this opportunity to de-inline specializations of
SimilarityTraits where possible.

BUG=324594

Review URL: https://codereview.chromium.org/98313002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@238085 0039d316-1c4b-4281-b951-d872f2087c98
SVN changes up to revision 238085
Fix crash when a JSON cloud policy's value is invalid

When a JSON cloud policy is set to an invalid value, DecodeJson() returns
a NULL pointer, which causes the PolicyMap::Entry for this policy to have
a |value| member of NULL. This is unsupported. The |value| member must
always be non-NULL.

The CL fixes the crash by not adding a PolicyMap::Entry when the policy
value cannot be parsed.

BUG=None
TEST=Manual

Review URL: https://codereview.chromium.org/96903004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@238086 0039d316-1c4b-4281-b951-d872f2087c98
SVN changes up to revision 238086