Support alternative statement types; refactor print handler