Introduce and use ARRAY_LENGTH macro

Avoids repeating literals and constants.  Also remove redundant
memset.
Merge pull request #25 from andrewgaul/array-length

Introduce and use ARRAY_LENGTH macro