Added test module for factor graphs.