Small bug fixes
Started to implement testthat for unit testing
House cleaning
House cleaning