Refactor and document database code

DatabaseHelper is a singleton; LocationAdapter.insertLocation takes an
android.location.Location instead of individual values;
CityAdapter.getNearestCity takes maximum distance as a parameter.