Fix issue where console stack values were getting overwritten

Fixes issue #976 by deferring the stack reset until the next root execution of script. Also adds code to ensure the initial string stack buffer is blank, preventing an issue with the terminal debugger code execution.