Make touchups (better errors and sets).

Use `map[string]struct{}` to create a set instead of `map[string]bool`.

Replace `fmt.Errorf("foo")` with `errors.New("foo")` throughout the
code.