Correctly decode empty arrays and maps

Fixes #42.
Add test cases for empty arrays and maps