Changed write_output_decs function definition so it didn't extend too much.

Fixed the amount of indentation for the unit declarations.

Added write_out_updates to generate the if towers for each output that we need for updates.