Make it all work with khan-exercises requirejs

Test Plan:
Loaded the page, saw no graph and no errors. Selected "9. Trigonometric function", saw a trig function. Clicked "Convert to Image", freaked out as I saw a 2x size image because I'm on a retina display; went to the live version and re-ran that template so the 5 items that use it don't die.

{F15706}

Reviewers: eater, jack

Reviewed By: jack

Subscribers: justinjaffray

Differential Revision: http://phabricator.khanacademy.org/D7961