Added library and unittests