Add initial support for saving traces to a custom location

 The implementation is still a WIP so not documented or recommended for use.