Properly escaping list separators when printing to SDF.

Fixing #733 
@dwightguth please review.
look into what you can do with @Test(expected=IllegalArgumentException)

It doesn't really matter, because style isn't as important for tests, but you should be aware of it.