fix #1124 by adding salt manip functions

Also, all data now has the magic number prepended. This is incompatible
for all but the save/load functions, but I think nothing besides the one
experimental qTox branch used any of those, which is why I'm okay
with the change.