Add template dependency to Mantle extension

Move all templating related code there.

Change-Id: Ia060b2295e011c136da17007df662cd98274f4e2
Merge "Add template dependency to Mantle extension"