Merge gsoc2012-doxygen branch

I'd like to merge this branch into master. There is still a lot of work to do here (and I intend to fix at least some bugs), but this seems to be already useful in its current state, i.e. it's better than nothing and doesn't seem to break anything not related to Doxygen (although this remains to be tested, which is another reason for creating this pull request: I hope Travis will do it for me).
This fails to trim if s is **all** spaces, as `find_last_not_of(' ')` will then return string::npos.  I wonder if this is the cause of the pep8 warnings about empty lines containing whitespace you were getting.

In fact, since `string::npos` is `string::size_type(-1)`, doing the erase unconditionally should work.