fix doc and test for getBest
make globals and test functions static
remove order checks in getPeers