Make assembly process more functional.

Instead of printf'ing code in one pass, accumulate lists of operations.
This will allow for multiple optimization passes, etc.