Improve the way quoting is handled in generated yaml
Improve handling of empty modules list
Update test to reflect the new format