Generate proper model names when dealing with uppercase tablenames.

Pull request for #3449
Let me test for various naming schemes and get back to you on that.