Added support for libraries

Included test cases for coverage

What's this for?