Rewrite autoscaling and enable easier configuration of worker selection and autoscaling behaviour

tests