Rework to be an installed library

See https://mail.gnome.org/archives/desktop-devel-list/2014-February/msg00028.html