Some more unit tests plus a little refactoring
Edit unit test plus merge the two basic testing modules