Fix error when searching posts by Link attribute

* Make sure we have the correct table name from the Post_Link object
* Add test to search by link attribute
Return main SQL query in JSON from /posts (if not in production)
Make sure subquery aliases are unique when searching posts attributes

Use attribute key not attribute type.
Make posts search DISTINCT so we don't get duple posts for multiple locati
Make BBox sub query alias unique
Add more GeoJSON tests and allow specifying geom attribute

* Add tests for getting posts by bounding box
* Add tests for post geojson with only specified location attr
* Add support for ?geometry_attribute= param to specify geometry attribute
  for geojson
Add post id and url to GeoJSON properties, hide full resource
Merge branch 'master' into geojson