Some refactoring in xoptions.c to separate out front-end