refactor cmake build system

Major rewrite of the cmake build system.
On Linux this creates the library (static and shared), packages and demosSandbox; `make install` correctly installs the shared library and the header file.
Basically this now can replace all `posix*` and `mingw` makefiles.

I hope I didn't break Windows and Mac side.