Rewrite problem.js, and split into problem.js and list.js