 
 
 
-    model = new Model()
-    view = new View (
-        el: '#learndb-view'
-        model: model
-    )
+
+
 
 
     # Setup router
-    router = Backbone.Router.extend (
+    Router = Backbone.Router.extend (
+
+        initialize: (@options) ->
 
         # Setup route definitions
         routes: (


        # Handle routing
        search_term: (term) ->
            model.set 'term', term
            model._doUPdate()
    )


    # Render view to initialize bindings

            @$el.find('.spinner').css 'visibility', (if visible then '' else 'hidden')

        _doUpdate: ->
            # Update the browser URL
            @options.router.navigate 'term/' + @model.get('term')
            @_loadAnim true
            socket.emit 'lookup', @model.get('term'), (err, res) =>
                @model.set res
                @_loadAnim false
