Adds a test on forward-backward transformation invariance. Also updating test_cdmodel for new return type of applyForward()/applyBackward().
 #524