Add option to serialize warnings to dicts (#160)