libbit: review fixes
libbit: add an unit test