Factoring out duplicate code.
Refactoring evaluate_list to (mostly) use the stack.