use basis.template.define
code clean up and small fixes
use basis.template.define and code clean up
style fix
fix bug with sorting
add missed require and remove basis.cssom dependancy