Fix bug in testing valid captures.
Add terminal.py for playing on the command line.
Merge remote-tracking branch 'upstream/master'