Rewrote salvaging more generally

I assume that salvageRef will be imported from the main class as this class imports the main class up the top (if it doesn't, please fix ;3). I haven't tested changes, but as I haven't done anything too unusual, it should all work. Hopefully.
???
Bug squishing
Merge pull request #1 from Dimpl/patch-4

Patch 4 is the new master