Refactors array-map tests so that they can be reused for other maps

Refactors array-map tests so that they can be reused for sorted-map and hash-map.

Also, fixes some spelling errors.