Fix cppcheck
Add valgrind custom command
Introduce test performed with google test framework.
Add some comment to main CMakeLists.txt.
Fix minor issues.