Escape globals consistently with how objectproxy handles escaping

DRY, reduce complexity