function ThreadManager (thread, compositor) {
	this.thread = thread;
	this.compositor = compositor;

    var _this = this;
	this.thread.onmessage = function (ev) {
        _this.compositor.receiveCommands(ev.data);
    };
}

ThreadManager.prototype.update = function update (time) {
    if (this.thread.postMessage) {
        this.thread.postMessage(['FRAME', time]);

        var threadMessages = this.compositor.drawCommands();
        this.thread.postMessage(threadMessages);
    } else {
        this.thread.receiveCommands(['FRAME', time]);

        var threadMessages = this.compositor.drawCommands();
        this.thread.receiveCommands(threadMessages);
    }
    
    this.compositor.clearCommands();
};

module.exports = ThreadManager;

@@ -215,16 +215,126 @@
 %0A    %7D;%0A
+    this.thread.oncommands = function (commands) %7B%0A        _this.compositor.receiveCommands(commands);%0A    %7D;%0A
 %7D%0A%0AThrea

Make ThreadManager accept clock