Sorting out test directory and adding unit tests