Change to optparse

I have changed over to optparse which is a leaner way of handling option parsing
and error conditions.
Merge pull request #1 from janies/feature/fixop

convert to a more complete optionlist