MJax-Includes is a project mainly written in PHP, it's free.
The Data Model and all included backend .php files for MJax