moved options parsing into separate file and created test

moved the options paring system into it's own function so that it may be testable