Add Unit tests

This PR adds unit tests to the lib to ensure functionality is not broken.