On the origin of the stellar initial mass function and multiple stellar systems