Move ArrayVariable to separate file and cleanup subtrees in destructor