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 ...

(have not tested it much, also it might be a good idea to add checks to not replace them in strings., etc...)