Python: Add back the context-importing behaviour of {{#some_context}}.
Improve errors and warnings in some places.