updated processResponseClass to allow nesting of array or list types. Also reduced lines of code and complexity.
updated toDeclaredType to allow nesting of array or list types. Also reduced lines of code and complexity.