Refactor label drawing to call MathJax just once

Test Plan:
Opened graphing_linear_equations.html locally and saw a graph with
labels. Opened perseus/test.html and saw that it loaded slightly less
slowly than before.

Reviewers: eater, emily

Reviewed By: eater

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