Shortens class name string if over a certain length