Reordering window creation functions.
Crash fix, rendering still broken.
More crash fixes related to Window implementation.