Update puzzle.js

Changed puzzle to the prototype class