Move demos into separate CMakeLists.txt
Add basic tests

For now the only thing checked is that header files compile by
themselves, e.g. includes and forward declarations in them are
complete and they do not require extra includes
Add missing includes and forward declarations