The Monitor project: rotation of low-mass stars in the open cluster M34