add amd and common js support