Tweaks to chain app

fix some bugs reading options in Chain, use faster inference for training, simplify traits, cleanup

also I used auto-format to get things indented to the right level - it might have spread some code out over more lines than necessary, so apologies for that.