Entanglement production with multimode Bose-einstein condensates in optical lattices