Added dollar-sign escaping, but it only works in non-math mode.

Need to refactor for math mode to be doable.