Add ReplaceSeries and refactor the CreateSeries function into smaller steps

This part of the test passes for a bad reason. The original rs.pubKeys gets manipulated in ReplaceSeries to be sorted alphabetically that's why these two are the same. If we correct that part of the code in putSeries where we sort to not do it with the same array, this test will fail.