Window code moved to class.

Added window base class.
todo:
-add methods to configure window
-add namespace
and more