Code cleanup and partial implementation of array opcodes