General Fixes and Improvements

This pull request will contain general fixes and cleanup.

* Implements texture_set_priority for Direct3D9
* Fixes texture issues from my earlier commit identified in #785 and effectively resolves the issue.

Due to the sheer urgency of the fixes provided this pull request can and should be merged immediately.