basic term indices and GADTs working

TODO
 - using predfined global definitions in term indices
 - normalization things, especially recursive definitions