Added tests and fixes for CompositeState with ShallowHistory behavior.

Signed-off-by: makulik <g-makulik@t-online.de>