Save an object to filesystem as a JSON file.

params Parameters describing the object. This should have an filename attribute containing the filename with which to save the object.
obj The object to save.
base_dir The directory in which to save the object.
mode The mode with which to open the file to write. Defaults to 'x', which means that the save will fail if the file already exists.

The full path to the saved JSON file.