Added support for libraries

Included test cases for coverage

I like that.