Add pop/push command

Targets #330.

Please review and comment.
Nope, it's _not_. Reversing the loop iteration doesn't help if the problem is your _indexing_ of the two arrays.