Not in this pull, but we should move CacheableHandler to do the same "base template_values var" thing LoggedInHandler does, then we won't need these temporary state variables and directly manipulate the template values dict.