Go plugin

A cherry picked version of #206.