Handling errors from chrome APIs.
Some Chrome API calls can fail and return 'undefined' result. Making our code not send crashes and behave reasonably in such cases.

Also, sending crashes if server sends malformed cards.

+ some smaller cleanups.

BUG=164227

Review URL: https://chromiumcodereview.appspot.com/22912021

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@219157 0039d316-1c4b-4281-b951-d872f2087c98
4 files changed