Major renaming (legend -> layer). Tests pass again.