Fixed tests running more than once
Added more docs and more tests