Turns out some weird scoping things were happening.
The `scopes` variable is being passed throughout by reference.
Which is great (yay speed improvements). In theory. Except...
All operations must therefore operate on scopes by reference.
`scopes = scopes[1:]` used to end a scope updates the reference.
This means the parent call to renderer doesn't leave the scope.
# If we're an end tag
if tag == 'end':
# Pop out of the latest scope
- scopes = scopes[1:]
+ del scopes[0]
# If the current scope is falsy and not the only scope
elif not current_scope and len(scopes) != 1: