test262.py crashes when --logfile due to reference to absent attribute 'logfile'

This unsquashed PR adds unit tests and fixes a crash in the python test runner (issue #114).

Not squashed yet for review.  The commits are in three parts:

1. add unit tests to cover PrintSummary function
2. reproduce and fix the crash
3. factor PrintSummary to write the same text to stdout and to log (if present).

The changes in categories 1,2 are needed to fix the crash.  The changes in category 3 just make me feel better about myself and can be dropped, if for some reaosn we wanted to preserve the trailing spaces and different capitalization between stdout and the logfile.