Add support for nested precompiled templates

fixes #280