Protect functions that throw away const-ness (check dirty flag) with mutex
Fix newlines (dos2unix) & superfluous whitespace
Fix cppcheck warnings
Bump minimum cmake version requirement
Fix typo in comment