ui/mainwindow.py: Organise and use absolute import statements

As described in PEP8.