don't use code::, add newlines after note::

this fixes build errors with the version of sphinx in debian wheezy.
reformat code to 80 columns

hard limit at 79 for Python, soft limit for C++.
minor unrelated cleanup.