Generate the define code in writer in the AMD/Generator
fix writer, reader to treat dependencies correctly