clean up NavigationHistory code to seriously shorten it

This removes the unused $_POST support and simplifies various loops