add define_class function to class.js

add class.js test
add canvas
add comments