Fixes #2676: safe functions for retrieving condition/grade by facility.

Fixes #2676.
I think a cleaner idiom would be `GRADE_BY_FACILITY.get(...) or GRADE_BY_FACILITY.get(...)` 

But it can be cleaned up later.