Added tests and rdoc