 window.system_db = 'rethinkdb'
 
 $ ->
+    # Load the driver
     window.r = require('rethinkdb')
     window.driver = new Driver
 
     main_view = new MainView.MainContainer()
     $('body').html main_view.render().$el
 
+    # We need to start the router after the main view is bound to the DOM
     main_view.start_router()
 
     Backbone.sync = (method, model, success, error) ->


    # Collect reql docs
    collect_reql_doc()



class @Driver

                            callback(err, result)


    # Run the query every `delay` ms
    # Returns a timeout number (to use with @stop_timer).
    # If `index` is provided, `run` will its value as a timer
    run: (query, delay, callback, index) =>
        if not index?
            @index++
        index = @index
        @timers[index] = {}
        ( (index) =>
            @connect (error, connection) =>
                if error?
