restored docs
added tests and test infrastructure