Change comment style and move functions to top
Change comment style and move functions to top

Explanation of comment style:

* comments that delineate a large block of related code use
  # BEGIN name, # END name with a blank line before and after
* comments that precede a small block use # NAME (caps)
* comments that directly precede a single statement or very small
  number of statements use regular comments

It would be nice if my editor would recognize # BEGIN and # END
and provide folding for that block.

I used to use ### block name ### and ### end block name ### for blocks
but that interferes with some coding standards like PEP8. I'm not sure
I don't still like that better.

kbd/setup,kbd/setup,kbd/setup,kbd/setup,kbd/setup