bgfx changes

* Rewrote setup in NSGL so we set the context to the window later.
* This fixes several issues including garbage on the screen and the fact that the window doesn't get proper updates
* Also some other various changes
Latest version with various fixes

* Now uses correct update from the new window setup
* Misc cleanup