diff --git a/src/test/java/com/google/devtools/build/lib/skylark/SkylarkRuleClassFunctionsTest.java b/src/test/java/com/google/devtools/build/lib/skylark/SkylarkRuleClassFunctionsTest.java
index 37d4cea..9067b89 100644
--- a/src/test/java/com/google/devtools/build/lib/skylark/SkylarkRuleClassFunctionsTest.java
+++ b/src/test/java/com/google/devtools/build/lib/skylark/SkylarkRuleClassFunctionsTest.java
@@ -37,17 +37,18 @@
 import com.google.devtools.build.lib.packages.RuleClass;
 import com.google.devtools.build.lib.packages.RuleClass.Builder.RuleClassType;
 import com.google.devtools.build.lib.packages.SkylarkAspect;
+import com.google.devtools.build.lib.packages.SkylarkAspectClass;
 import com.google.devtools.build.lib.packages.SkylarkClassObject;
 import com.google.devtools.build.lib.packages.SkylarkClassObjectConstructor;
 import com.google.devtools.build.lib.packages.SkylarkProviderIdentifier;
 import com.google.devtools.build.lib.rules.SkylarkAttr;
 import com.google.devtools.build.lib.rules.SkylarkFileType;
-import com.google.devtools.build.lib.rules.SkylarkRuleClassFunctions;
 import com.google.devtools.build.lib.rules.SkylarkRuleClassFunctions.RuleFunction;
+import com.google.devtools.build.lib.skyframe.SkylarkImportLookupFunction;
 import com.google.devtools.build.lib.skylark.util.SkylarkTestCase;
+import com.google.devtools.build.lib.syntax.BuildFileAST;
 import com.google.devtools.build.lib.syntax.ClassObject;
 import com.google.devtools.build.lib.syntax.Environment;
-import com.google.devtools.build.lib.syntax.EvalException;
 import com.google.devtools.build.lib.syntax.EvalUtils;
 import com.google.devtools.build.lib.syntax.SkylarkDict;
 import com.google.devtools.build.lib.syntax.SkylarkList.MutableList;
@@ -96,36 +97,37 @@
 
   @Test
   public void testCannotOverrideBuiltInAttribute() throws Exception {
-    ev.setFailFast(true);
+    ev.setFailFast(false);
     try {
       evalAndExport(
           "def impl(ctx): return", "r = rule(impl, attrs = {'tags': attr.string_list()})");
       Assert.fail("Expected error '"
           + "There is already a built-in attribute 'tags' which cannot be overridden"
           + "' but got no error");
-    } catch (EvalException e) {
-      assertThat(e).hasMessage(
+    } catch (AssertionError e) {
+      assertThat(e.getMessage()).contains(
           "There is already a built-in attribute 'tags' which cannot be overridden");
     }
   }
 
   @Test
   public void testCannotOverrideBuiltInAttributeName() throws Exception {
-    ev.setFailFast(true);
+    ev.setFailFast(false);
     try {
       evalAndExport(
           "def impl(ctx): return", "r = rule(impl, attrs = {'name': attr.string()})");
       Assert.fail("Expected error '"
           + "There is already a built-in attribute 'name' which cannot be overridden"
           + "' but got no error");
-    } catch (EvalException e) {
-      assertThat(e).hasMessage(
+    } catch (AssertionError e) {
+      assertThat(e.getMessage()).contains(
           "There is already a built-in attribute 'name' which cannot be overridden");
     }
   }
 
   @Test
   public void testImplicitArgsAttribute() throws Exception {
+    ev.setFailFast(false);
     evalAndExport(
         "def _impl(ctx):",
         "  pass",
@@ -263,18 +265,32 @@
 
   @Test
   public void testLabelListWithAspects() throws Exception {
-    SkylarkAttr.Descriptor attr =
-        (SkylarkAttr.Descriptor) evalRuleClassCode(
+    evalAndExport(
             "def _impl(target, ctx):",
             "   pass",
             "my_aspect = aspect(implementation = _impl)",
-            "attr.label_list(aspects = [my_aspect])");
-    Object aspect = ev.lookup("my_aspect");
+            "a = attr.label_list(aspects = [my_aspect])");
+    SkylarkAttr.Descriptor attr = (SkylarkAttr.Descriptor) ev.lookup("a");
+            SkylarkAspect aspect = (SkylarkAspect) ev.lookup("my_aspect");
     assertThat(aspect).isNotNull();
-    assertThat(attr.getAspects()).containsExactly(aspect);
+    assertThat(attr.build("xxx").getAspectClasses()).containsExactly(aspect.getAspectClass());
   }
 
   @Test
+  public void testLabelWithAspects() throws Exception {
+    evalAndExport(
+        "def _impl(target, ctx):",
+        "   pass",
+        "my_aspect = aspect(implementation = _impl)",
+        "a = attr.label(aspects = [my_aspect])");
+    SkylarkAttr.Descriptor attr = (SkylarkAttr.Descriptor) ev.lookup("a");
+    SkylarkAspect aspect = (SkylarkAspect) ev.lookup("my_aspect");
+    assertThat(aspect).isNotNull();
+    assertThat(attr.build("xxx").getAspectClasses()).containsExactly(aspect.getAspectClass());
+  }
+
+
+  @Test
   public void testLabelListWithAspectsError() throws Exception {
     checkErrorContains(
         "expected type 'Aspect' for 'aspects' element but got type 'int' instead",
@@ -492,8 +508,10 @@
   }
 
   protected void evalAndExport(String... lines) throws Exception {
-    eval(lines);
-    SkylarkRuleClassFunctions.exportRuleFunctionsAndAspects(ev.getEnvironment(), FAKE_LABEL);
+    BuildFileAST buildFileAST = BuildFileAST.parseAndValidateSkylarkString(
+        ev.getEnvironment(), lines);
+    SkylarkImportLookupFunction.execAndExport(
+        buildFileAST, FAKE_LABEL, ev.getEventHandler(), ev.getEnvironment());
   }
 
   @Test
@@ -1221,6 +1239,44 @@
     assertThat(requiredProviders.isSatisfiedBy(AdvertisedProviderSet.EMPTY)).isFalse();
   }
 
+  @Test
+  public void fancyExports() throws Exception {
+    evalAndExport(
+        "def _impla(target, ctx): pass",
+        "p, (a, p1) = [",
+        "   provider(),",
+        "   [ aspect(_impla),",
+        "     provider() ]",
+        "]"
+    );
+    SkylarkClassObjectConstructor p = (SkylarkClassObjectConstructor) lookup("p");
+    SkylarkAspect a = (SkylarkAspect) lookup("a");
+    SkylarkClassObjectConstructor p1 = (SkylarkClassObjectConstructor) lookup("p1");
+    assertThat(p.getPrintableName()).isEqualTo("p");
+    assertThat(p.getKey())
+        .isEqualTo(new SkylarkClassObjectConstructor.SkylarkKey(FAKE_LABEL, "p"));
+    assertThat(p1.getPrintableName()).isEqualTo("p1");
+    assertThat(p1.getKey())
+        .isEqualTo(new SkylarkClassObjectConstructor.SkylarkKey(FAKE_LABEL, "p1"));
+    assertThat(a.getAspectClass()).isEqualTo(
+        new SkylarkAspectClass(FAKE_LABEL, "a")
+    );
+  }
+
+  @Test
+  public void multipleTopLevels() throws Exception {
+    evalAndExport(
+        "p = provider()",
+        "p1 = p"
+    );
+    SkylarkClassObjectConstructor p = (SkylarkClassObjectConstructor) lookup("p");
+    SkylarkClassObjectConstructor p1 = (SkylarkClassObjectConstructor) lookup("p1");
+    assertThat(p).isEqualTo(p1);
+    assertThat(p.getKey())
+        .isEqualTo(new SkylarkClassObjectConstructor.SkylarkKey(FAKE_LABEL, "p"));
+    assertThat(p1.getKey())
+        .isEqualTo(new SkylarkClassObjectConstructor.SkylarkKey(FAKE_LABEL, "p"));
+  }
 
 
   @Test
diff --git a/src/test/java/com/google/devtools/build/lib/syntax/LValueBoundNamesTest.java b/src/test/java/com/google/devtools/build/lib/syntax/LValueBoundNamesTest.java
new file mode 100644
index 0000000..69bede7
--- /dev/null
+++ b/src/test/java/com/google/devtools/build/lib/syntax/LValueBoundNamesTest.java
@@ -0,0 +1,57 @@
+// Copyright 2006 The Bazel Authors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//    http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+package com.google.devtools.build.lib.syntax;
+
+import com.google.common.truth.Truth;
+import java.util.Arrays;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
+
+/** A test for {@link LValue#boundNames()}. */
+@RunWith(JUnit4.class)
+public class LValueBoundNamesTest {
+
+  @Test
+  public void simpleAssignment() {
+    assertBoundNames("x = 1", "x");
+  }
+
+  @Test
+  public void listAssignment() {
+    assertBoundNames("x, y = 1", "x", "y");
+  }
+
+  @Test
+  public void complexListAssignment() {
+    assertBoundNames("x, [y] = 1", "x", "y");
+  }
+
+  @Test
+  public void arrayElementAssignment() {
+    assertBoundNames("x[1] = 1");
+  }
+
+  @Test
+  public void complexListAssignment2() {
+    assertBoundNames("[[x], y], [z, w[1]] = 1", "x", "y", "z");
+  }
+
+  private static void assertBoundNames(String assignement, String... boundNames) {
+    BuildFileAST buildFileAST = BuildFileAST
+        .parseSkylarkString(Environment.FAIL_FAST_HANDLER, assignement);
+    LValue lValue = ((AssignmentStatement) buildFileAST.getStatements().get(0)).getLValue();
+    Truth.assertThat(lValue.boundNames()).containsExactlyElementsIn(Arrays.asList(boundNames));
+  }
+}
diff --git a/src/test/java/com/google/devtools/build/lib/syntax/util/EvaluationTestCase.java b/src/test/java/com/google/devtools/build/lib/syntax/util/EvaluationTestCase.java
index 3a04c67..d76e2eb 100644
--- a/src/test/java/com/google/devtools/build/lib/syntax/util/EvaluationTestCase.java
+++ b/src/test/java/com/google/devtools/build/lib/syntax/util/EvaluationTestCase.java
@@ -125,7 +125,7 @@
     setMode(TestMode.BUILD);
   }
 
-  protected EventHandler getEventHandler() {
+  public EventHandler getEventHandler() {
     return eventCollectionApparatus.reporter();
   }
 
