Merged from jdong; lots of escaping fixes

Benjamin Mako Hill || Want to submit a patch?