Fix oculus and more (rebased)
The primary reason for this branch was just to fix Oculus support. It got out of hand and now has a bunch of general fixes. Check out the commits for most of it.
It builds on windows and linux currently.
This has been rebased with edited commit messages.