Change representation of begin/end sentinels.

Previously, the sentinels involved a cylic dependency:

    BEGIN.post = END, END.pre = BEGIN

That isn't a crazy thing to do, but introducing a cycle into the dependency
graph causes various complications. It seems better to have only a single
constraint (e.g., BEGIN.post = END). In a subsequent commit, we'll require that
no constraints have END as their pre link; hence, END should still appear at the
end of the document.
Check for invalid document states in NmSimpleLinear.