Added tests/testthat.R to run tests during R CMD check. Closes #8