Fuse subsequent assignments to the same cell
Factor traversal of Programs into separate function

This greatly simplfies the individual optimization phases.
Split 'merge' optimization into four separate phases

Simplifies the code IMHO.
Added nice type alias for 'Program -> Program'

...called "Optimization".
Spread code over multiple files

It became a bit much for a single file IMHO.