parseopts: normalize options into an array