Add inner templates.

When switching to the class template, we want to add all current user code into a main method.
This main method will then be part of the user's content.
This commit does exactly that.