Updated the Makefile.am to include the tests dir. untabified more files. refactored code to use geo_functions.c