Added factory pattern to WindowManager

+WindowManager does all the memory management for windows
Improved documentation