Cleaned up some memory leaks, got rid of gsequence, improved test macro to free memory that it allocated