Added view type getter and ensured element render events would get the proper type

Need a new line before each var declaration and function.