Add drvector.h header.
Attempt to move invariant code out of callback functions.