use material key in eval
Improve branching speed ot endgame functions, and make things more scalable for implementing more endgame functions at low runtime cost.

No functional change.
signature = 6767533