Minimal but very flexible implementation of the expect pattern

WWW: https://github.com/dwt/pyexpect
