Support repositoryClass on MappedSuperclass

Supersedes #790 and includes squashed commits from @stephandesouza.