Large refactoring, mainly for revamping the type handling code.

I'm still a bit of a git newbie, so this pull request accidentally has the changes to the CDash location, which will need to be removed before merging the changes into the unidata/netcdf-c master branch.