Generate proper model names when dealing with uppercase tablenames.

Pull request for #3449
It will break generation of names for `tableName`.