server: refactor algo endpoints into Traversal.java
Instead of individual classes for traversal algorithms, use methods.