Move more escaping logic to Escaper

Change-Id: I626e9dc5edd63ff4666dbc38d220d6fffcfa2055