Extract box creation/transformation functions into box.js.