Simplified emitted files handling in use macros
Converted more tests to CMake