app: simplify config loading code, handle errors too