Fix scripting commands for document object
Replace tabs with 4x spaces in sdef
Fix document saving via script