Only get visited distances onces per iteration
Fix indeterminate dependencies
Cleanup

* Add some type hints
* Remove use of unneeded thread macro