Lock when reading View.IsScratch, too.
Add a lock to the log writer.
Pull Edit into its own file.