The diagonalator: An alternative cost functional for wave-equation inversion