     throw new Error "Missing definition at top level"
 
 topLevelModule = (moduleName, defaultImports) -> (ctx, form) ->
-  [jsVarDeclaration (validIdentifier moduleName),
-    (exportAll ctx, (join (importAny defaultImports), (topLevel ctx, form)))]
+  ctx.setModuleName moduleName
+  [(jsAssign (jsAccess "Shem", (validIdentifier moduleName)),
+    (exportAll ctx, (join (importAny defaultImports), (topLevel ctx, form))))]
 
 topLevelExpressionInModule = (defaultImports) -> (ctx, expression) ->
   (iife (concat [

    name: dictName
    params: (map validIdentifier, allFieldNames)
    body: paramAssigns)
  [constrFn]

dictAccessors = (constrName, dictName, fieldNames) ->

  }
}
;
var Shem = Shem || {};
"""


