Split the details of generating script syntax into a generator class: one for amend (whose output should be equivalent to the current output), and one for edify. Fix 'otatools' build rule to build imgdiff.