move tests form inst/tests to tests/testthat and adapt test files