Remove usage of Agent::singleton_ from agent_route and agent_path

Re-arranging of code to have related functions together
Remove unused functions