cmake: added sanitizers

Can be used in Clang >= 3.0 and gcc >= 4.8
cmake: added modeline

Also cleaned up commented code
cache: use memmove for overlpping ranges