Refactor settings a bit and add more tests.

This also includes now building NetCDF so we can (at least) do the DAP4
tests.