backporting changes

from: https://github.com/GigaOM/go-contentwidgets/pull/3 and https://github.com/GigaOM/go-contentwidgets/pull/4