Helper functions for dealing with array types

Fixes #82.
Merge pull request #84 from jponge/wip/fix-82

Helper functions for dealing with array types