Refactor pipe.py including support for command history.
Drop support for history as there was no nice way to populate it
Update pipe workflow with latest additions