Refactor, redis support on Debian and CentOS, minor improvements