XD-268: Some cleanup in options management

As I started working on XD-262, did some cleanup on options management, basically removing duplication.

Still not happy with xd.home that is dealt with at so many levels (script, main, etc)