Backport lumiMask feature to 0995b branch (also includes 5324)

As discussed with Eric and Seangchan, this is a merge of the following PR:
 - #5132 (was already in)
 - #5135 (was already in) 
 - #5188 (was already in)
 - #5233 
 - #5239 
 - #5324 (needs to be tested)
intended to backport the lumiMask feature/fixes into 0.9.95b branch.
@ticoann , do not merge it yet please. We need to first test it a bit.