Remove `GUI.process_events` call from the tests as the widget is always ready.
Minor commenting.
Move the util method to get a free port in a file of its own.

There are more places than the ipython notebook where I need the ability to
obtain a free port.
Use a generic free port for the web tests instead of hardcoding ports.
Add a fix for PyQt creating weird QPyNullVariant for None objects.