add possibility to encode Iterable objects

tests are pass.
in addition fixed crash in python3 x86_64 if option double_precision was specified.