Initial support for arrays

Also include some renames and necessary refactorings