refactor and code tweaks

commands sort-of work, config setting doesn't though - might be a
split() implementation issue