Make the set of characters that count as word characters customizeable with a helper

Issue #2426