     var activeSessionTask: NSURLSessionTask?
     var activeVisitable: Visitable?
     
-    var navigationDispatchGroup: dispatch_group_t?
-
     lazy var webView: WKWebView = {
         let configuration = WKWebViewConfiguration()
         configuration.userContentController = WKUserContentController()

    func visitableForLocation(location: NSURL, session: Session) -> Visitable
}

class Session: NSObject, WKNavigationDelegate, WKScriptMessageHandler, VisitableDelegate {
    weak var delegate: SessionDelegate?


    
    // MARK: Navigation Lifecycle
    
    private var navigating: Bool = false
    private var navigationLock: Lock?

    private func willNavigate() {
        if !navigating {
            self.navigating = true
            createNavigationLock()
        }
    }
    
    private func didCancelNavigation() {
        if navigating {
            self.navigating = false
            destroyNavigationLock()
        }
    }
   
    private func didNavigate() {
        if navigating {
            self.visiting = false
            self.navigating = false
            unlockNavigationLock()
        }
    }
    
    private func createNavigationLock() {
        self.navigationLock = Lock(queue: dispatch_get_main_queue())
    }
    
    private func destroyNavigationLock() {
        self.navigationLock = nil
    }
    
    private func unlockNavigationLock() {
        navigationLock?.unlock()
    }

    private func afterSuccessfulNavigation(completion: () -> ()) {
        navigationLock?.afterUnlock(completion)
    }
}

