extract part of monitoring lib to x/lib/gcm.

The main purpose is to let allocatord to use those functions
to retrieve data from GCM to render dashboard.

MultiPart: 2/2
Change-Id: I2aed93cb8f93a9334280bf4bd909d4d72f7deba8
4 files changed