Generating generalized necklaces and new quasi-cyclic codes