Fix for issue #125. 

Flags an exception when Noncaching chain is encountered in factor algorithms. Added tests in VE and BP as well.