properly escape all declaration names in generated imports