FAIMS-274 - add geometry tools and refactor database query to be in one class