SERVER-6062 stripTrailing now erases sequences of symbols + some basicTests for it

Please add a short comment on how you are shifting all the characters not in "chars" to the beginning of the string.