more renamings regarding edge.value → edge.weight; fixed some locking to prevent half-hanging edges in race conditions