Allow defaults.get to work from inside a jinja template

The previous version looked for a couple of values from a specific frame in the stack. This new version will look for a few specific keys, scanning through the stack. This fixed a problem where defaults.get wouldn't return results when called inside a jinja template.