Merge pull request #80 from mwarusz/master

thanks!
adding Profile mode to CMake
quite probably a fix to the mutex galore problem found by Maciek  (not tested too much... sorry)
Merge remote-tracking branch 'upstream/master'