Improved the used types detection.

Improved the used types detection. No more arrays, generic parameters
and generic instances.
Added custom attributes to the set of used types.
Removing module references ("user32.dll").