code cleanup and made postgis geometry parsing asynchronous

Change-Id: I53d9c452a7e4b1713bf2ce37a0ddb236b4f3c8f4