Added GCM functionality. Hopefully feature complete for now