Cast things and use UIApplication to get the keyWindow
Merge pull request #42 from facebook/various_fixes

Cast things and use UIApplication to get the keyWindow