As this causes issues with overload resolution, this commit instead separates global and local key handling into differently named functions. From now on, functions that deal with global keys have "global" in the name.