Bug #27, filter out sufficiently similar BSSIDs

This adds a filtering step to queries such that BSSIDs that are "similar enough" to each other get collapsed into clusters, and only a single element is chosen from each cluster.

Along the way I added a generic and more-robust (slower but more correct) clustering algorithm and rewrote the existing wifi-clustering operation done as part of position-estimation to use it.

A few tests which were feeding too-similar or invalid BSSIDs had to change but otherwise it seems to work.
The purpose of this test is to confirm that the filtering is happening after the database query, rather than before it.

If the filtering happened before the DB query, the keys would all filter to a single cluster and there would be only one "sufficiently different" key, which would be rejected as a query because there aren't enough keys (>= 2). If the filtering happens after the DB query, in this case only two are found (0x1f and 0x24) and those are sufficiently different that they pass, and the query proceeds.