Change replace_svg_object.py to be per-sample

The script now works on a per-sample basis, this means that it can be
run in parallel for each of the samples that need a figure generated.