M28 misc fixes

# Warning
# Info
# Issues
Fixes #926 
Fixes #1138 
Fixes #1079 
I think we can avoid the duplication of variables by just using the map here, i.e. mapIdToOpp = new map<Id, Opportunity>(database.query(strSoql));