Converted project to a library and added unit tests