Major cleanup to reduce diff in respect to stable

Most of them are cleanups that would be done anyway. This will ease checking what we need to do in stable to get closer to core.