Solenya does pretty much exactly what you've described:
https://github.com/solenya-group/solenya
Interestingly, in a very early version classes were allowed to be expressed as arrays of strings just like you had, but in the vast majority of cases a space delimited string worked fine, so this feature was dropped for simplicity/uniformity.