Implement basic location queries.

Database queries cannot do range checks on both longitude and latitude
at once, so we use a simple geohash to do both in one. Basically, the
coordinates are divided into buckets, and we search for everything in that
bucket at once.

Doing proper geohashing that works evenly across the whole planet seems
pointless given that there won't be many locations near the poles.
Trim the edges of the seatch area.