Change build flag defaults.
Make sure optimizations are removed when NO_OPTIMIZE CMake flag is set.
Merge branch 'cmaketests'