Move some defs around
Move config options into a separate object, and clean up the interface a bit