Separate release and debug builds supported

Release and debug builds can be made using cmake switch -DCMAKE_BUILD_TYPE=Debug or =Release with Release as default one.
Release build has no debug info and -O2 optimization level, while debug build contains debug info (-g) and no optimization (-O0).