use config.load_layered_config
document config usage, tweak loggind and exception handling
big reorganization of pipeline core
lots of chunks of big block of code lifted to functions