Update common.js

support functions and classes