+# A Streamline.js friendly evented I/O b-tree for node.js.
+#
+# ## Purpose
+# 
+# Implements a file backed b-tree.
+
+# Requried node.js libraries.
+fs = require "fs"
+
+# Copy values from one hash into another.
 extend = (to, from) ->
   to[key] = value for key, value of from
   to
 
-fs = require "fs"
-
+# Useful for command debugging. If you don't see them called in the code, it
+# means the code is absolutely bug free.
 die = (splat...) ->
   console.log.apply null, splat if splat.length
   process.exit 1
 say = (splat...) -> console.log.apply null, splat
 
-class Decisions
-  constructor: (@initial, @subsequent, @swap, @penultimate) ->
+# Default comparator is good only for strings, use a - b for numbers.
+comparator = (a, b) ->
+  if a < b then -1 else if a > b then 1 else 0
+
+# Default extractor returns the value as hole, i.e. tree of integers.
+extractor = (a) -> a
 
 # Glossary:
+# 
 #  * Descent - What we call an attempt to move from a parent node to a child
 #              node in  the tree, which may be paused because it encounters a
 #              lock on a tier.
+
+#              
 class Mutation
-  # The constructure always felt like a dangerous place to be doing anything
+  # The constructor always felt like a dangerous place to be doing anything
   # meaningful in C++ or Java.
   constructor: (@strata, @object, @key, @operation) ->
     @io         = @strata._io

  # value, as long as we let go of it immediately. This allows us to read from
  # leaf pages to get branch values.
  # TODO: Rename this descend.
  mutate: (_) ->
    parent = null


      locks.shift()
      true
    false

class LeafIO
  constructor: (@filename) ->
