Fix various sage import locations
Merge pull request #280 from jdemeyer/fix_imports

Fix various sage import locations
Use atomic_write() to have no corruption in case of crashes