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 aafb6ae..0cca153 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
@@ -9,9 +9,9 @@
                             $('#result0a').html(res["results"]);
                           } 
             })
-            .bind( new ForClause("user", null, new AsterixExpression().set(["dataset FacebookUsers"])) )
+            .bind( new ForClause("user", null, new AExpression().set("dataset FacebookUsers")) )
             .bind( new WhereClause(new BooleanExpression("$user.id = 8")) )
-            .bind({ "return" : new AsterixExpression().set(["$user"]) });
+            .bind({ "return" : new AExpression().set("$user") });
         
         expression0a.run();
     });
@@ -27,7 +27,7 @@
                               $('#result0b').html(res["results"]);
                           },
             })
-            .bind( new ForClause("user", null, new AsterixExpression().set(["dataset FacebookUsers"])) )
+            .bind( new ForClause("user", null, new AExpression().set("dataset FacebookUsers")) )
             .bind( new WhereClause( new BooleanExpression("AND", new BooleanExpression(">=", "$user.id", 2), new BooleanExpression("<=", "$user.id", 4)) ) )
             .bind( new ReturnClause("$user") );
         alert(expression0b.val());
@@ -201,7 +201,7 @@
                             $('#result9a').html(res["results"]);
                           }
         })
-        .bind( new ForClause("t", null, new AsterixExpression().set(["dataset TweetMessages"])))
+        .bind( new ForClause("t", null, new AExpression().set("dataset TweetMessages")))
         .bind( new GroupClause("uid", new AExpression().set("$t.user.screen-name"), "with", "t") )
         .bind( new ReturnClause(
             {
@@ -209,7 +209,7 @@
                 "count" : new FunctionExpression(
                             { 
                                 "function" : "count",
-                                "expression" : new AsterixExpression().set(["$t"])
+                                "expression" : new AExpression().set("$t")
                             }
                 )
             }
@@ -228,7 +228,7 @@
                             $('#result9b').html(res["results"]);
                           }
         })
-        .bind( new ForClause("t", null, new AsterixExpression().set(["dataset TweetMessages"]))) 
+        .bind( new ForClause("t", null, new AExpression().set("dataset TweetMessages"))) 
         .bind( new AQLClause().set("/*+ hash*/"))  
         .bind( new GroupClause("uid", new AExpression().set("$t.user.screen-name"), "with", "t") )
         .bind( new ReturnClause(
@@ -237,7 +237,7 @@
                 "count" : new FunctionExpression(
                             { 
                                 "function" : "count",
-                                "expression" : new AsterixExpression().set(["$t"])
+                                "expression" : new AExpression().set("$t")
                             }
                 )
             }
@@ -256,19 +256,19 @@
                             $('#result10').html(res["results"]);
                           }
         })
-        .bind( new ForClause("t", null, new AsterixExpression().set(["dataset TweetMessages"])))
+        .bind( new ForClause("t", null, new AExpression().set("dataset TweetMessages")))
         .bind( new GroupClause("uid", new AExpression().set("$t.user.screen-name"), "with", "t") )
         .bind( new LetClause(
             "c", 
             new FunctionExpression(
                 { 
                     "function" : "count",
-                    "expression" : new AsterixExpression().set(["$t"])
+                    "expression" : new AExpression().set("$t")
                 }
             )
         ))
         .bind( new OrderbyClause( new AExpression().set("$c"), "desc" ) )
-        .bind( new LimitClause(new AsterixExpression().set(["3"])) )
+        .bind( new LimitClause(new AExpression().set("3")) )
         .bind( new ReturnClause(
             {
                 "user" : "$uid",
@@ -291,7 +291,7 @@
         })
         .bind( new SetStatement( "simfunction", "jaccard" ))
         .bind( new SetStatement( "simthreshold", "0.3"))
-        .bind( new ForClause( "t", null, new AsterixExpression().set(["dataset TweetMessages"]) ))
+        .bind( new ForClause( "t", null, new AExpression().set("dataset TweetMessages") ))
         .bind( new ReturnClause({
             "tweet"         : new AExpression().set("$t"),       
             "similar-tweets": new FLWOGRExpression()
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 d24bca3..9a11c75 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
@@ -1,134 +1,3 @@
-function AsterixSDK() {
-
-    // Asterix SDK => send
-    // Posts a message containing an API endpoint, json data,
-    // and a UI callback function.
-    //
-    // @param handler [Asterix REST Controller], a handler object
-    // that provides REST request information. 
-    //
-    // Anticipated Usage:
-    //
-    // var a = AsterixSDK();
-    // var e = Expression;
-    // var h = AsterixRestController.bind(e);
-    // a.send(h);
-    myThis = this;
-    this.callbacks = {
-        "sync" : function() { alert("default sync"); },
-        "async" : function() {}
-    };
-    this.send = function(handler, cb) {
-        myThis.callbacks = cb;
-        this.handler = handler;
-        this.extras = handler["extras"];
-        this.xhr.post(
-            handler["endpoint"],
-            handler["apiData"],
-            this.branch          
-        );
-    };
-
-    this.branch = function(response) {
-        if (response && response["error-code"]) {
-           
-            alert("Error [Code" + response["error-code"][0] + "]: " + response["error-code"][1]);
-            
-        } else if (response && response["results"]) {
-            var fn_callback = myThis.callbacks["sync"];
-            fn_callback(response, myThis.extras);
-            
-        } else if (response["handle"]) {
-            
-            var fn_callback = this.callbacks["async"];
-            fn_callback(response, extra);
-            
-        } else if (response["status"]) {
-                
-            var fn_callback = this.callbacks["sync"];
-            fn_callback(response, extra);
-        }
-    }
-
-    // Asterix SDK => bindingHandler
-    // AsterixExpression form handler where a new REST API point is bound. Takes as input any
-    // AsterixExpression, each of which is bindable.
-    this.bindingHandler = new AsterixExpression();
-    this.bind = this.bindingHandler.bind;
-}
-
-function AsterixExpression() {
-    this.init();
-    return this;
-}
-
-AsterixExpression.prototype.init = function () {
-    this.dataverse = ""; // TODO This shouldn't make it to send
-    this.boundTo = {};
-    this.clauses = [];
-    this.ui_callback_on_success = function() {};
-    this.ui_callback_on_success_async = function() {};
-};
-
-AsterixExpression.prototype.bind = function(expression) {
-    // If expression is an AsterixExpression, it becomes base
-    if (expression instanceof AsterixExpression) {
-        this.boundTo = expression;
-    } else if (expression instanceof AsterixClause) {
-        this.clauses.push(expression.val());
-    }
-    return this;
-};
-
-AsterixExpression.prototype.send = function(arc) {
-    // Hackiest of hacks
-    var g = new AsterixSDK();
-    g.send(arc, arc["callback"]);
-};
-
-AsterixExpression.prototype.clear = function() {
-    this.clauses.length = 0;
-    return this;
-};
-
-AsterixExpression.prototype.val = function() {
-    return this.clauses.join("\n"); 
-};
-
-AsterixExpression.prototype.success = function(fn, isSync) {
-    if (isSync) {
-        this.ui_callback_on_success = fn;
-    } else { 
-        this.ui_callback_on_success_async = fn;
-    }
-    return this;
-};
-
-AsterixExpression.prototype.set = function(statements_arr) {
-    for (var i = 0; i < statements_arr.length; i++) {
-        this.clauses.push(statements_arr[i]);
-    }
-    return this;
-};
-
-AsterixExpression.prototype.use_dataverse = function(dv) {
-    this.dataverse = dv;
-    this.clauses.push("use dataverse " + dv + ";");
-    return this; 
-};
-
-AsterixExpression.prototype.return = function(return_object) {
-    var components = [];
-    for (var key in return_object) {
-        components.push('"' + key + '" : ' + return_object[key]);
-    }
-    
-    var return_expression = 'return { ' + components.join(', ') + ' }'; 
-    this.clauses.push(return_expression);
-    return this;
-};
-
-
 // Functions that can be used to call core expressions/clauses more cleanly
 function AFLWOGR () {
 
@@ -461,7 +330,7 @@
         this._properties["clause"] += "}";  
     
     } else {
-        this._properties["clause"] += new AsterixExpression().set([expression]).val();
+        this._properties["clause"] += new AExpression().set(expression).val();
     }
 
     return this;
@@ -718,3 +587,41 @@
     var value = AExpression.prototype.val.call(this);
     return "(" + value + ")";    
 };
+
+
+// Functions that can be used to call core expressions/clauses more cleanly
+function AFLWOGR () {
+
+}
+
+function AClause () {
+
+}
+
+function ALetClause () {
+
+}
+
+function AWhereClause () {
+
+}
+
+function AOrderbyClause () {
+
+}
+
+function AGroupClause () {
+
+}
+
+function ALimitClause () {
+
+}
+
+function ADistinctClause () {
+
+}
+
+function AVariable () {
+
+}
