Made equation escaping more robust
Added new test for unforced newlines