Renamed setLayouts to setLayout and moved to a standalone function
Added Writer with Marshal method to output slices of structs as csv-encoded output