Add unit tests (test.cpp) and Makefile. Bug-fix for the erase() (and friends) methods.