Vast number of code fixes.

Note: skybox still broken