DS-2125 Fix possible NPEs in Context object commit/complete/abort. Also add Unit Tests for Context object