Clean up imports/impl and fix (or drastically slow) mem leak caused by opening lots of xcb connections
Merge in ztream changes from upstream