Implement equation reordering in `build.py`

Implement equation reordering in `build.py`, calling code from
`optimise.order`.