Added support for libraries

Included test cases for coverage

May look at [depd](https://www.npmjs.org/package/depd), just for giving some nicities around deprecation messages