Added immutable sorted bags and TreeBag implementation