 			catch error
 				console.log "#{@name}: couldnt set clientid"
 
+		# Initialize callbacks,
 		@cb_events = ['notify', 'notify_init', 'notify_version', 'local', 'get', 'ready', 'notify_pending', 'error']
 		@cbs = {}
 		@cb_e = @cb_l = @cb_ni = @cb_np = null
 		@cb_n = @cb_nv = @cb_r = ->
 
+		# state flags,
 		@initialized = false
 		@authorized = false
+		@started = false
+
+		# and client-side copy of data.
+		# The client-side copy contains
 		@data =
+			# the CV,
 			last_cv: 0
+			# a duplicate previntion ID,
 			ccid: @uuid()
+			# a copy of each bucket item,
 			store: {}
+			# a queue of changes to send to the server,
 			send_queue: []
+			# and a timeout for sending the queue
 			send_queue_timer: null
 
-		@started = false
-
+
+		# Each bucket can keep a copy of its data in `localStorage` to persist state across
+		# pageloads when the network is down.
 		if not ('nostore' of @options)
+			# The `localStorage` mechanism is on by default
 			@_load_meta()
 			@loaded = @_load_data()
 			console.log "#{@name}: localstorage loaded #{@loaded} entities"
 		else
+			# but can be turned off with the `'nostore'` option.
 			console.log "#{@name}: not loading from localstorage"
 			@loaded = 0
 
+		
+		# Tracks changes to the pending items in the send_queue.  Used by the `notify_pending` callback.
 		@_last_pending = null
 		@_send_backoff = 15000
 		@_backoff_max = 120000

			if to_load is 0 and @index_request is false
				@_index_loaded()

	_index_loaded: =>
		console.log "#{@name}: index loaded, initialized: #{@initialized}"
		if @initialized is false
			@cb_r()
		@initialized = true
		console.log "#{@name}: retrieve changes from index loaded"
		@retrieve_changes()

	# id: id of object

			setTimeout do(item) =>
				=> @on_entity_version(item['d'], item['id'], item['v'])

		# If the response is the last page of the index, then we're done.
		if not ('mark' of response) or 'limit' of @options
			# 1. Unset the "currently doing an index request" state flag
			@index_request = false
			# 2. Set the CV. @todo We should be checking the CV for each page request.
			if 'current' of response
				@data.last_cv = response['current']
				@_save_meta()
			else
				@data.last_cv = 0
			# 3. If it wasn't already called above by `@on_entity_version()`, call `@_index_loaded()`, which sets `@initialized`.
			if loaded is 0
				@_index_loaded()
		# Otherwise, we need to request the next page.
		else
			# 1. Reset the "currently doing an index request" state flag
			@index_request = true
			console.log "#{@name}: index last process time: #{@now() - now}, page_delay: #{@options['page_delay']}"
			# 2. Wait `@options['page_delay']` milliseconds and request the next 100 items.
			mark = response['mark']
			page_req = (mark) =>
				# Request: Index, with data, from item {mark}, since the beginning of time, return 100 items
				@send("i:1:#{mark}::100")
				@irequest_time = @now()

			setTimeout( (do(mark) =>
				=> page_req(mark)), @options['page_delay'])

	# Useless? Never called.
	on_index_error: =>
		console.log "#{@name}: index doesnt exist or other error"

