 		}
 		self.wsSource.send(data)
 	}
-	
-	//MARK: private methods
-	
+}
+
+//MARK: private methods
+private extension Session {
 	//assumes currentContents of document is what should be sent to the server
 	///returns a token to uniquely identify this transaction, encoded into the message data
-	private func encodeDocumentSaveMessage(document:EditorDocument, data:NSMutableData) -> String {
+	func encodeDocumentSaveMessage(document:EditorDocument, data:NSMutableData) -> String {
 		let uniqueIdent = NSUUID().UUIDString
 		let encoder = MessagePackEncoder()
 		var attrs = ["msg":MessageValue.forValue("save"), "apiVersion":MessageValue.forValue(Int(1))]

		}
	}
	
	private func handleFileResponse(transId:String, operation:FileOperation, file:File) {
		switch(operation) {
		case .Duplicate:
			//TODO: support

	///if we are getting variable updates from the server
	private var watchingVariables:Bool = false
	
	
	//MARK: init/open/close
	init(_ wspace:Workspace,  source:WebSocketSource, appStatus:AppStatus, networkConfig config:NSURLSessionConfiguration, delegate:SessionDelegate?=nil)
	{
		workspace = wspace
