Major revisions.

Moved almost all the saveindex stuf to a seperate class and file.
Added program arguments. (only partly implemented)
Removed some unused code.

The program no longer takes a filename by default, and now outputs a file called saveindex.new

Todo:  Finish moving everything into the saveindex class.