Factor nodes now contain a factor object instead of a pointer. Refactor the way .fg and .uai formats are readed.