internal/v4: refactor tests

We create a table with an entry for each kind of metadata so
that it's easy to add new entries and new tests that
test the metadata in arbitrary configurations without
writing reams of duplicated test code.

We also fix router so that it works correctly with
typed nil data, which avoids an if statement in
every metadata handler.
internal/v4: add sanity checks for metadata
	update dependencies to match juju-core's deps.
Merge pull request #45 from rogpeppe/015-api-test-refactor

internal/v4: refactor tests

We create a table with an entry for each kind of metadata so
that it's easy to add new entries and new tests that
test the metadata in arbitrary configurations without
writing reams of duplicated test code.

We also fix router so that it works correctly with
typed nil data, which avoids an if statement in
every metadata handler.