cmake: refactor common code with executables
cmake: refactor common code with libraries
cmake: handle private vs. public headers
cmake: put each test executable in its own directory