Bugfix: BasePort.__exit__() didn't close port.
Cleaned up backends and fixed some bugs.