Some refactoring of the console inteface.

Reduce some state duplication, by removing currentflow variable.

Fixes #141