Found bug in last pull request

Fixing bug in last rev of FieldType.getArrayType(), adding more tests to cover that, and replacing more switch blocks with algorithmically-determined cached state.

When looking at the component/array type mappings, it was taking the first match in getArrayType() when it should have restricted to the first (and hopefully only) non-nullable array type for that component type.