Introduced the internal_data level for references & private data + major
fixes everywhere.