Added two passes, for clearing comments and for collecting type defs per type. Fixed a possible crash with the multiple inheritance.

Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>