Check for window object to allow testing modules using this