Removed redundancy and did more optparse stuff.

Apparently you don't need the IO monad for option parsing and you can use read to get the double/int values.
Don't know if this works, but I'm starting to make sense of some of the code now...