Allow changing the default infile name.

Now use propper exit command instead of just returning from main.
Now using a vector to store indexes.

Much more flexible/safe than the old array method with new and delete.