lib.query2 organizational cleanup

This just changes

query2/

to

query2/   # Code common to query, cquery, aquery
  aquery/ # aquery-specific code
  query/  # query-specific code
  cquery/ # cquery-specific code

Lots of files reference each other so it's a huge change, but conceptually shallow.

This isn't perfect. Some classes probably aren't in the right place. Some should probably be refactored into their command-specific vs. generic parts. And it'd be nice to separate cquery, query, and aquery into independent BUILD libraries. But BUILD refactoring makes this 10x worse and as-is I think this makes navigation easier.

PiperOrigin-RevId: 247015827
diff --git a/src/main/java/com/google/devtools/build/lib/query2/PostAnalysisQueryEnvironment.java b/src/main/java/com/google/devtools/build/lib/query2/PostAnalysisQueryEnvironment.java
index edefd40..e6c3dac 100644
--- a/src/main/java/com/google/devtools/build/lib/query2/PostAnalysisQueryEnvironment.java
+++ b/src/main/java/com/google/devtools/build/lib/query2/PostAnalysisQueryEnvironment.java
@@ -225,11 +225,11 @@
   protected abstract T getNullConfiguredTarget(Label label) throws InterruptedException;
 
   @Nullable
-  ConfiguredTargetValue getConfiguredTargetValue(SkyKey key) throws InterruptedException {
+  public ConfiguredTargetValue getConfiguredTargetValue(SkyKey key) throws InterruptedException {
     return (ConfiguredTargetValue) walkableGraphSupplier.get().getValue(key);
   }
 
-  ImmutableSet<PathFragment> getBlacklistedPackagePrefixesPathFragments()
+  public ImmutableSet<PathFragment> getBlacklistedPackagePrefixesPathFragments()
       throws InterruptedException {
     return ((BlacklistedPackagePrefixesValue)
             walkableGraphSupplier.get().getValue(BlacklistedPackagePrefixesValue.key()))
@@ -248,7 +248,7 @@
     return targetPatternKey.getParsedPattern();
   }
 
-  ThreadSafeMutableSet<T> getFwdDeps(Iterable<T> targets) throws InterruptedException {
+  public ThreadSafeMutableSet<T> getFwdDeps(Iterable<T> targets) throws InterruptedException {
     Map<SkyKey, T> targetsByKey = Maps.newHashMapWithExpectedSize(Iterables.size(targets));
     for (T target : targets) {
       targetsByKey.put(getSkyKey(target), target);
@@ -494,14 +494,14 @@
       nulls = nullsBuilder.build();
     }
 
-    boolean isTopLevelTarget(Label label) {
+    public boolean isTopLevelTarget(Label label) {
       return nonNulls.containsKey(label) || nulls.contains(label);
     }
 
     // This method returns the configuration of a top-level target if it's not null-configured and
     // otherwise returns null (signifying it is null configured).
     @Nullable
-    BuildConfiguration getConfigurationForTopLevelTarget(Label label) {
+    public BuildConfiguration getConfigurationForTopLevelTarget(Label label) {
       Preconditions.checkArgument(
           isTopLevelTarget(label),
           "Attempting to get top-level configuration for non-top-level target %s.",