bugfix: support zero length arrays

Closes #17 with some additional tests and changelog.

@dmbelov looks good to you?