Rewrite artwork.js to make it self-reliant