adds a helper class, converts glance to use it.

this commit adds a common helper class, which should be used by all
plugins. also converts the glance plugin to use it.