refactor: split out the stash functionality from the optimizer

Conflicts:

	src/analysis.jsx
	src/jsemitter.jsx