initial implementation of a segment merge function.  moved implementation of ipages into an object expression.  moved write lock request into a function which returns an F# option.