Allow entity() and repository() to take in class name in String

This mutates the state of the collection, and makes it thread unsafe. We shouldn't cache it for now.