Initial commit of lib and tests