Code cleanup and compatibility fixes for Windows 8
Compatibility updates, and modal view updates