change %o and %i references when saving, so they point to the actual index of the expression in the order the expressions appear in the file

When a file is saved and loaded again, all cells are renumbered  instead of keeping the numbers they had, which makes all %o/%i references completely useless. 

This patch changes all references on saving, so a reference to the first output [input] cell becomes %o1 [%i1], to the 2nd %o2 ...