Fix indexing error adding items with repeated words

Probably words that didn't make it into the same in-memory insertion
batch, since the UNION would make those distinct.

Follow up to #440
Fix (caught) error accessing this.decoder due to private method call

Follow-up to #440
API change: item.attachmentCharset now returns charset name, not ID

Since apparently half of our own code didn't know that it returned an
ID...

The item.attachmentCharset setter can still take either name or ID.