started to refactor FactorGraph to support generic potentials that can be provided by clients. Eventually potentials should also replace the current setting and score tables in factors to clean things up.