add a unittest, clean up lib structure, all dartdoc comments