Many unit tests added, along with a minor change for testing in mainOption settings