Changed history parsing to be in python

- BH_PREV_COMMAND is the output of the previous history line.
- Chop that line up in python since the number of spaces were inconsistent.