Clean up save-RES, make button locations more consistent

Fixes #645, #646
Replace attributes with .data()

Made some other jQuery modifications/fixes