Fixed xor in netutil.js changing unsigned ints to signed. Fixed bad conditional in netutil.js. Added test for sortPeersByDistance.