Move algorithms to tools directory