[BZ-996056] fix package cloning when there is a pattern using a class literal referring to a type declaration
(cherry picked from commit cdbc45f88a424816d77dc3adda1c3f4ce1dffada)
[DROOLS-234] returning rule names per package instead of per kbase
(cherry picked from commit 7047168152a20e07f99b3643d9730492f87d7a75)
BZ-1000055: added test for NPE during KieSession serialization
BZ-1000055: fixing NPE on RIANode serialization