Modifications needed for nested fact support

These are the minimum changes that we need to have nested facts plugin. I checked that ```includes``` is not needed to avoid n+1 queries problem.