TS: Fixed that forward declaration folded into the top network did not sort on dependencies towards user types.
TS: Refactored out the user type, array, constants, namespace level declarations into separate printer and also generate to separate c&h-files from the network setup code.