Begin refactor or georef.cpp (was georef.c). Changed some heap memory allocations to stack based.