Refactored assertion of vertex/edge counts.

assertio function now returns a function which can be directly supplied to tryCommit.