check.py: fixed PEP8, global errors list

PEP8 changes:
* two lines before function definition
* shortened too long lines (except for one regexp)

Switched to logging:
* now a list of errors for each category is shared between functions

Removed global list of errors:
* instead functions pass a reference to the list that's held in `main()`
* two new formatting helpers: `add_error(msg, errors)` and
  `add_suberror(msg, errors)` -- if you want to know details how they
  work, take a look at their docstrings

Greg, I checked `index.html` from this repository (`workshop-template`) and the script worked. We actually should have some tests against that script, but I'm soon leaving for [Christmas Eve Supper](http://en.wikipedia.org/wiki/Twelve-dish_Christmas_Eve_supper)…