Fix bug in view expansion when two views have the same field types but different field names. Also, generate names of join fields that will be valid java identifiers.