implement some window apis

Implements some window APIs: `switchToDefaultFrame`, `switchToFrame`, `getCurrentWindowHandle`, `switchToWindow`, `closeWindow`.