libwindow: Reorganized code and fixed @Veltas ' nitpicks
libwindow: Started platform independent code