Import width inference code from DREAMER

Chisel's Flo backend doesn't output widths attached to every node,
just some of them.  This attempts to infer the widths of every node in
a manner that will match what Chisel does internally.

Unfortunately this appears to have a bug...