Weak widget references / pep8 for some methods

This was done on top of the previous pull request (so, includes both). The main change is that the widgets are now kept as weak references when adding them through add_widget (this way it's possible to add a widget for debug purposes but still make a test which can check if the widget would be properly garbage-collected).