Add window manager

Refactor controllers