tests: replace tabs with spaces

This is achieved with the following command:
find tests -name '*.py' | xargs sed -i -e 's!\t!        !g'

In python2 its a warning to mix spaces and tabs, in python3 it's a
runtime error. So no more tabs in python files, just spaces.
Convert from python2 to python3

This is one big ugly patch, but I don't really see a way to make a
working transition without this ugliness, since any splitting of these
changes would cause the framework to raise a runtime exception.

This is the output of the 2to3 tool provided by python, with a few
manual edits for style and to replace list(iterator) with plain
iterators, which are fine for our use

It also does the following:
- replace #!/usr/bin/python with #!/usr/bin/python3
- Fix changes to haning indents
- fix slots operator in status.py:
  - In python3 __slots__ behaves slightly differently than in python2,
    in that a class attribute does not fulfill a slot, but actually
    conflicts with it. For more information see:
    http://bugs.python.org/issue12766
- Fix bytes, strings and unicode
  - In python2 regex strings are usually of the raw type: r'(foo|bar)',
    but in python3 they need to be of the same type as the strings they
    are to be applied to. In dmesg this is bytes, so b'(foo|bar)'
  - One of the huge advantages to moving to python3 is that there is no
    ambiguity between unicode and byte strings. Bytes are explicitly
    marked as such and everything is unicode.
- Fix functions that have moved from modules or been renamed
  - A number of types have been moved into the global namespace in
    python3, among them types.IntType and types.LongType have been
    replaced with int and types.FloatType have been replaced with float.

What it doesn't do:
- junit