added __gc event hack for tables
fixed memory leaks from external data