FactorSim: Generative Simulation via Factorized Representation