Refactoring sculpting codes into skulpt.js