changed project to use CMakeLists; use cmake with generator to get project for Code::Blocks
compiling with pthread in cmake
splitted source code into separate files