Merged prob.h, factorgraph.h, factograph.cpp from SVN head (broken!)