Make maximum template depth configurable