Cosmin: Update for Dynamic Windows

1. Minimize button is working now.
2. Code cleanup
3. Simpler way of adding buttons

Maybe to do:
- Persist the values inside the windows
- The event when a window is closed using it's button is still
hardcoded. A way to make it dynamic should be found and implemented.