Correct declaration for scope_key.

@nedbat @cpennington Previously, this code was: 

1) Missing the field name. 
2) Gave relatively unclean keys. 

This PR fixes both issue. 

Rapid review would be appreciated, since we're about to start prototyping things on prod which rely on this. If we can get this out, it will save us a migration later. 
Would it be clearer to just define the substitutions like this, rather than using `itertools.product`?

Also, it might be better to have them as a global, rather than recomputing the list every time this function is called.