Add PRE/POST_ITERATION hooks.  Use in NS example.