Enhance class matching to accept space-separated list or array of class names.