SDK Review Feedback: Fix ReturnClause and TinySocial 8 bug
diff --git a/asterix-app/src/main/resources/sdk/static/example/js/demo.js b/asterix-app/src/main/resources/sdk/static/example/js/demo.js
index 8d515a7..7ca6ab6 100644
--- a/asterix-app/src/main/resources/sdk/static/example/js/demo.js
+++ b/asterix-app/src/main/resources/sdk/static/example/js/demo.js
@@ -1,4 +1,9 @@
 $(document).ready(function() {
+    
+    //A = AsterixSDK({
+     //   "dataverse" : "TinySocial
+    //});
+    //a.run(expression, fn);
 
     // 0A - Exact-Match Lookup
     $('#run0a').click(function () {
@@ -50,12 +55,6 @@
         expression1.run(success1);
     });
         
-       //     "similar-tweets": new FLWOGRExpression()
-       //                         .bind( new ForClause( "t2", null, new AExpression().set("dataset TweetMessages") ))
-     //                           .bind( new AQLClause().set("where $t2.referred-topics ~= $t.referred-topics and $t2.tweetid != $t.tweetid") )
-      //                          .bind( new ReturnClause("$t2.referred-topics"))
-      //  })); 
-        
     // 2A - Equijoin
     $("#run2a").click(function() {
         $('#result2a').html('');
@@ -154,7 +153,7 @@
                 "twitter-screenname": "$tu.screen-name",
                 "twitter-name": "$tu.name"
             });
-
+        // TODO Move Sets!
         var expression5 = new FLWOGRExpression()
             .bind( new SetStatement( "simfunction", "edit-distance" ))
             .bind( new SetStatement( "simthreshold", "3"))
@@ -231,7 +230,8 @@
 
         var expression8 = new FunctionExpression(
             "count",
-            new ForClause("fbu", null, new AQLClause().set("dataset FacebookUsers"))
+            new FLWOGRExpression()
+                .bind( new ForClause("fbu", null, new AQLClause().set("dataset FacebookUsers")))
                 .ReturnClause("$fbu")
         );
         
diff --git a/asterix-app/src/main/resources/sdk/static/js/asterix-sdk-stable.js b/asterix-app/src/main/resources/sdk/static/js/asterix-sdk-stable.js
index 15d992c..207c393 100644
--- a/asterix-app/src/main/resources/sdk/static/js/asterix-sdk-stable.js
+++ b/asterix-app/src/main/resources/sdk/static/js/asterix-sdk-stable.js
@@ -30,6 +30,9 @@
         dataType : "json",
         success : function(data) {     
             success_fn(data);
+        },
+        error: function(r) {
+            //alert(JSON.stringify(r));
         }
     });
 
@@ -60,12 +63,6 @@
 };
 
 
-// Pretty AExpressAliases
-AExpression.prototype.ReturnClause = function(expression) {
-    return this.bind(new ReturnClause(expression));
-};
-
-
 // FunctionExpression
 // Parent: AsterixExpression
 // 
@@ -190,6 +187,10 @@
 };
 
 
+FLWOGRExpression.prototype.ReturnClause = function(expression) {
+    return this.bind(new ReturnClause(expression));
+};
+
 // AQLClause
 //
 // Base Clause  ::= ForClause | LetClause | WhereClause | OrderbyClause | GroupClause | LimitClause | DistinctClause
@@ -219,12 +220,6 @@
 };
 
 
-AQLClause.prototype.ReturnClause = function(expression) {
-    return this.bind(new ReturnClause(expression));
-};
-
-
-
 // ForClause
 //
 // Grammar:
@@ -485,7 +480,7 @@
     var expressions = [];
     var variableRefs = [];
     var isDecor = false;
-
+    
     while (expc < arguments.length) {
 
         if (arguments[expc] instanceof AExpression) {
@@ -533,18 +528,6 @@
 GroupClause.prototype = Object.create(AQLClause.prototype);
 GroupClause.prototype.constructor = GroupClause;
 
-// BooleanExpression
-// 
-// TODO
-function BooleanExpression(expression) {
-    this.value = expression;
-    alert("Debugging Bool: " + arguments.length + " " + expression);
-} 
-
-BooleanExpression.prototype.val = function() {
-    return this.value;
-}
-
 
 // SetStatement
 //