added tests in inst/tests directory
copied over from testing branch