Plugin updates to handle templates, bugfixes to code viewer