Fix bugs around sorting_index calculations, that occured when adding entry in
the middle of a group that looked like this (prior to recalculating indexes):
  update entitiesinagroup set (sorting_index) = (-8455201536643956736) where group_id=-9223372036854769749 and entity_id=-9223372036854738728;
  update entitiesinagroup set (sorting_index) = (-8071116286538547200) where group_id=-9223372036854769749 and entity_id=-9223372036854738427;
  update entitiesinagroup set (sorting_index) = (-7687031036433137664) where group_id=-9223372036854769749 and entity_id=-9223372036854744513;
  update entitiesinagroup set (sorting_index) = (-7302945786327728128) where group_id=-9223372036854769749 and entity_id=-9223372036854744466;
  update entitiesinagroup set (sorting_index) = (-6918860536222318592) where group_id=-9223372036854769749 and entity_id=-9223372036854744625;
  update entitiesinagroup set (sorting_index) = (-6150690036011499520) where group_id=-9223372036854769749 and entity_id=-9223372036854745113;
  update entitiesinagroup set (sorting_index) = (-4614349035589861376) where group_id=-9223372036854769749 and entity_id=-9223372036854744626;
  update entitiesinagroup set (sorting_index) = ( 9223372036854775795) where group_id=-9223372036854769749 and entity_id=-9223372036854738430;
  update entitiesinagroup set (sorting_index) = ( 9223372036854775796) where group_id=-9223372036854769749 and entity_id=-9223372036854738428;
  update entitiesinagroup set (sorting_index) = ( 9223372036854775797) where group_id=-9223372036854769749 and entity_id=-9223372036854738429;
  update entitiesinagroup set (sorting_index) = ( 9223372036854775798) where group_id=-9223372036854769749 and entity_id=-9223372036854750702;
  update entitiesinagroup set (sorting_index) = ( 9223372036854775799) where group_id=-9223372036854769749 and entity_id=-9223372036854750811;
  update entitiesinagroup set (sorting_index) = ( 9223372036854775800) where group_id=-9223372036854769749 and entity_id=-9223372036854738768;
  update entitiesinagroup set (sorting_index) = ( 9223372036854775801) where group_id=-9223372036854769749 and entity_id=-9223372036854738769;
  update entitiesinagroup set (sorting_index) = ( 9223372036854775802) where group_id=-9223372036854769749 and entity_id=-9223372036854738770;
  update entitiesinagroup set (sorting_index) = ( 9223372036854775803) where group_id=-9223372036854769749 and entity_id=-9223372036854738771;
  update entitiesinagroup set (sorting_index) = ( 9223372036854775804) where group_id=-9223372036854769749 and entity_id=-9223372036854738972;
  update entitiesinagroup set (sorting_index) = ( 9223372036854775805) where group_id=-9223372036854769749 and entity_id=-9223372036854738973;
  update entitiesinagroup set (sorting_index) = ( 9223372036854775806) where group_id=-9223372036854769749 and entity_id=-9223372036854738974;
  update entitiesinagroup set (sorting_index) = ( 9223372036854775807) where group_id=-9223372036854769749 and entity_id=-9223372036854760006;

Also removed a duplicate method and reformatted a bit (which ideally would have been in separate commits!, but so far it's
just me and the holiday is ending).