Fix bug in testing valid captures.
Add terminal.py for playing on the command line.