Node-webkit compatibility

Make leap controller node-webkit friendly by checking _global_ variable instead of _window_