  We study numerically the evolution of rotating cloud cores, from the collapse
of a magnetically supercritical core to the formation of a protostar and the
development of a protostellar disk during the main accretion phase. We find
that the disk quickly becomes unstable to the development of a spiral structure
similar to that observed recently in AB Aurigae. A continuous infall of matter
from the protostellar envelope makes the protostellar disk unstable, leading to
spiral arms and the formation of dense protostellar/protoplanetary clumps
within them. The growing strength of spiral arms and ensuing redistribution of
mass and angular momentum creates a strong centrifugal disbalance in the disk
and triggers bursts of mass accretion during which the dense
protostellar/protoplanetary clumps fall onto the central protostar. These
episodes of clump infall may manifest themselves as episodes of vigorous
accretion rate (\ge 10^{-4} M_sun/yr) as is observed in FU Orionis variables.
Between these accretion bursts, the protostar is characterized by a low
accretion rate (< 10^{-6} M_sun/yr). During the phase of episodic accretion,
the mass of the protostellar disk remains less than or comparable to the mass
of the protostar.
