added testthat
First version with full documentation