support library and listeners

Signed-off-by: Jonas Kalderstam <jonas@kalderstam.se>