add support for save/dump to path rather than str