Factored out dual averaging, also using it in LARJ to estimate branching factor for recursion-depth-biased importance sampling of structural variables.