Some code cleanup.

I should have split this commit into smaller pieces. Anyway, this is the
list of changes:

* Refactoring the update_menu method:
    * Split that method into 3 methods: one for updating the GTK+ menu,
      one for parsing a single config line, one for reading/parsing the
      config file.
    * Parsing a config line includes doctests, which serves as both
      tests and documentation.
* Adding --test parameter to run the doctests.
* Forcing Python 2.x at the shebang.
* Removing trailing whitespace.
* Changing double-quotes to single-quotes.