Support large systems with TNG
Currently TNG is prohibitive slow for very large systems. I gave up waiting after ~10min to write a file for a system containing 2M atoms. The problem is that several functions search large tables for every atom in the system. E.g. tng_chain_residue_find (O(N^2), N: residues) or tng_residue_atom_w_id_add (O(NM) N: total number of atoms, M:atoms per residue). It seems, TNG needs to be profiled for a large system, and those searches need to be replaced with hash-table lookups.