Move the files to the right place to be able to use the test_package function in the testthat package.
Added inline documentation and tidied the code