Add support for strongly typed arrays

Fixes #2