Major cleanup to entityToProperty.pl