add write_gcm plugin

It looks like there are some unrelated changes here