cycles: Extended cycle_basis to work with multigraphs.