ellipsize window title if it's length is longer than 100

I'm adding the ellipsizeString and ellipsizedWindowTitle functions at top level because I'm unsure where they would likely fit.

Maybe, consider making the 100 magic value a custom setting.