Improve normalization and sanitization of memcached keys