DROOLS-64 + DROOLS-88

DROOLS-64 (Trait modify should preserve type inheritance) + 
DROOLS-88 (Use generics in type declarations' fields)

Comes with two useful general purpose algorithms
- Hierarchy linearization (extracted from a previous, ad-hoc implementation for type declares)
- Incremental Hierarchy encoding for fast sub-sup queries/tests

Should be forward-ported to 6.x