Removing debugging markup
Finished figure texts
Detects script folder and stores history at same directory as script