Fixed build problems when OOFEG, IML or MPI was enabled. Some headers and forward declarations where restructured to avoid circular inclusions.