reorganized files and added recursive types
split types into own file, started on substitution