Changed lots of stuff in window management mechanism

- Moved all windows related code to another file
- Renamed some function and changed them to work with windows references
  instead of window IDs
- Added window scenes support (currently unused)
- Refactored some graphics code