fixes including multiple libraries, implements window z-index stack and other window-related fixes