Fix latest version
Add reverse sorting to the directory walking to ensure that the latest version of a set of versioned file is always the first one that's seen and add that to a set to make sure that only the first file is sent to the latest core.
This replicates how the old Python code handled this. It's a sub optimal solution but the other ways of handling this would be more complex so this is hopefully good enough for now.