Parse "selectedLanguage" from input extras

and send it to the server if EXTRA_LANGUAGE is not set.
Some keyboard apps prefer to set "selectedLanguage" instead of
EXTRA_LANGUAGE.

Other changes:

  - communicate the value of EXTRA_PARTIAL_RESULTS to the server
  - fix regression from previous commit (results sometimes not returned)
  - more logging