Change template parsing to use better nesting

Modified the template parsing to put each template in a map, rather than
all in one template. This way is likely less performant, but offers the
ability to use {{template}} inside of the layout and {{defined}} in the
child. For this to work, a new Layouts property must be used on the
options to specify all possible layout files. Performance could be
improved if we forced the user to specify which files need which layout.