updated to allow backward compatible templates via this.attr
updated unit tests