Cleanup pretty print function.
Initial work on a state machine for CSR control.
Update gitignore.