add karma/jasmine tests and make public/global object with functions to call