Separated cpp files into different classes (and changed config.cmake correspondingly)