Bug fix/deferred

Fixes to deferred, namely it didn't support getting called from an arbitrary method (`add_constraints`).  The fix was to pass the context into `deferred(..)` in certain situations.