Why is display mathjax code in a div?

1. You can't put a div inside a span.
2. MathJax puts it on a new line either way.

Added classes for both inline and display math so they can be styled to emulate the MathJax behaviour.