Refactor smarty plugins hacky includes. Closes #154