Added support for libraries

Included test cases for coverage

`appsPublisher` and `libsPublisher` share a lot of code.  Please refactor them to eliminate duplication.