Fixed a bug stopping the treeview from rendering with more recent versions of Kendo UI, and cleaned up the code a little.