added tests and docs for factorial.h