MongoDB support and some improvement

Allow configuration settings in config.yml
Allow cache_lifetime=0, unlimited
Clean cache: also cleans the log to keep the last 24 hours