Fixes a problem with StringEncoder encoding strings inproperly

probably introduced while removing garbage instances produced by it.
Here's another attempt, one that works. Also StringIdMapperTest is changed
to encode strings that were seen as troublesome previously, namely "1",
"2"... a.s.o.