Damn. I started building exactly the same thing a couple weeks ago.
https://github.com/equationscp/equationscp