Miniaod ports of #4914 #4833 #4862 #5037 #5230  plus #5425 and other fixes

This PR should include all fixes from 
https://twiki.cern.ch/twiki/bin/view/CMS/MiniAODCSA14FollowUp

It is made on top of #5525 from Sal

It also includes fixes for PAT AK4 switching