Bridge dependencies in the TemplateContext to avoid massive case statements

Fixes #128