Fix marshalling of empty byte[]/Buffer
Fix #35 & #68: dynamic support
add test for marshaling of empty buffers