Google Cloud Messaging part 1 and some smallfixes.