Implemented first PoC

Wrapped it with [juju/errgo](https://github.com/juju/errgo) instead.