swh-graph: refactor algo implementations
This is the first part of #1898 (closed), refactoring the neighbors traversal code logic into a custom iterator. Next step is to merge the algorithms into a Traversal.java (this will be easier to review separately).
Migrated from D1700 (view on Phabricator)