 class KDRouter extends KDObject
+
+  {history} = window
 
   listenerKey = 'ಠ_ಠ'
 
   createObjectRef =(obj)->
-    return unless obj?.bongo_? and obj?.getId?
+    return unless obj?.bongo_? and obj.getId?
     constructorName   : obj.bongo_?.constructorName
     id                : obj.getId()
 

    listeners = node[listenerKey]
    if listeners?.length
      listener.call @, routeInfo, state, path  for listener in listeners

  addRoutes:(routes)->
    @addRoute route, listener  for own route, listener of routes

  handleRoute:(userRoute, options={})->
    [frag, query...] = (userRoute ? @getDefaultRoute?() ? '/').split '?'

    query = @utils.parseQuery query.join '&'

    {shouldPushState, replaceState, state} = options
    shouldPushState ?= yes
    
    objRef = createObjectRef state

    node = @tree
    params = {}
    
