Added tests for rendering; changed "template" to a function so that it will be evaluated when it's invoked and not when the script is loaded (i.e. the template text doesn't have to be loaded until the template function is invoked)