added a testing function for convenience; moved readProgram and initialMemory to the top level
major refactoring of execute function: wrote every case in terms of the same primitive helper function 'step'