Port arrays to STL containers

memory, registers and stack are now proper STL containers (std::array,
and std::deque through std::stack)