Add collection types decoding

And some fixes for tests.
Closes #9.