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.
all: use errgo.

This almost entirely an automated change, made by running
the errfix comment. (code.google.com/p/rog-go/exp/cmd/errfix)
all: fix misplaced comments
Merge pull request #47 from rogpeppe/018-use-errgo

all: use errgo.

This almost entirely an automated change, made by running
the errfix comment. (code.google.com/p/rog-go/exp/cmd/errfix)
all: use charm.v3

Change to use charm.Reference throughout.
charmstore/router: generate http.StatusNotFound appropriately
add params/error.go
more error masking; more error tests; more comments
update dependencies.tsv
update dependencies.tsv for new charm.v3 version
Merge pull request #49 from rogpeppe/020-use-charm.v3

all: use charm.v3

Change to use charm.Reference throughout.

dependencies.tsv not changed because charm.v3 has not yet landed, so
we don't have the commit ref.
Merge branch 'v4' into 021-http-status

Conflicts:
	internal/router/router.go
	internal/router/router_test.go
	internal/v4/api.go
rename charm.URL to charm.Reference after merge
fix typo
Merge pull request #50 from rogpeppe/021-http-status

charmstore/router: generate http.StatusNotFound appropriately

This generates messages (and error codes) as expected by the API specification.
internal/charmstore: copy stats logic from _old and update
sortimports
internal/v4: update for NewStore error return