CMake + CPack + fixes

Info from lamvak:
Build system changed to CMake. Added support for package building with CPack.
Additionally, stub of C preprocessor symbols analysis.

Extra adds:
- small fixes (typos and oblivions)
- write config.h.in instead of generate
- change variables/functions names
- more .gitignore entries