Gcm protocol and client improvements.

- error code in response
- client now handles generic errors
- added cli client for gcm