The joint replenishment problem with general joint cost structures