Updated the way template lookup was done so that it would properly be injected in tests.
Updates to inject template lookup.
Updated the template processing to log out some of the steps for better debugging.