Escape strings and treat browser host objects differently