Change output formatting to better show port locks and numbers.

Show port numbers next to inputs and outputs and locks next to
outputs to better reflect the logic for their manipulation.