Separated magicpen.js into multiple files