Added support for running in node where there is no window object