Merge pull request #13 from oroulet/master

fix bugs, add test and merging.
add 2 small tests
set variant as array when it is an array while decoding!!!!