add MySQL backend plus refactoring

This patch goes together with : 
1. https://github.com/cms-sw/cmsdist/pull/292
2. https://github.com/dmwm/WMCore/pull/4875

I have done basic tests but surely the MySQL part requires further validation cycles. I think we could make a review and then check in the code, in parallel we test and validate.