Further development of generated deserialization.

Code for deserialization collections and primitive types
added. Some bugs removed. Probably new ones introduced.