Update class.js

add 'new' method