Prevent FirefoxOS showing a tooltip if the user entered a password but not a vpassword in the set password screen.

fixes #3502
Constrain tooltips to be displayed on the screen.
Fix the failing front end test when run in PhantomJS.
Cleanup on the "email_chosen" state and reduce duplication of code.

* Code that decided how to handle transition states and clear certs was sprinkled throughout the code, making it difficult to maintain.
* Move cert invalidation that happened in state.js into user.js.
* Rename user.js->checkEmailIssuer to checkForInvalidCerts
* Simplify checkForInvalidCerts
* Add more unit tests.
Merge pull request #3511 from mozilla/issue_3496-tooltips-off-screen

Constrain tooltips to be displayed on the screen.
Merge pull request #3513 from mozilla/issue_3502_set_password

Prevent FirefoxOS showing a tooltip if the user entered a password but not a vpassword in the set password screen.
Submit KPI data when the dialog closes either in the interaction_iframe OR in the internal_api.

Only generate GUIDs for a KPI blob whenever needed:

* When the dialog is orphaned AND
* A staging event occurs without a confirmation event.
Update for FirefoxOS

us_matchers is now a table, the key is the OS, the value is the string to search for.

Add the current FirefoxOS string

fixes #3373
Merge pull request #3523 from mozilla/issue_3373_b2g_ua_parser

Update coarse user agent parser for FirefoxOS
'native' is reserved on Android 2.2, so access it array-style. Fixes 3522.
Instead of sending a GUID to associate two KPI blobs, set "staging_continuation" in the event stream.
Fix a couple instances of reserved word 'native' in tests.
Merge pull request #3534 from 6a68/issue_3522_fml_android22

'native' is reserved on Android 2.2, so access it array-style.
Merge pull request #3495 from shane-tomlinson/issue_3306_kpi_this_session

Submit KPI data when the dialog closes either in the interaction_iframe OR in the internal_api.
Make sure all expected KPIs are sent.

~ 4% of the KPI blobs were missing:
* number_emails
* number_sites_signed_in
* number_sites_remembered
* orphaned

The problem is that occasionally, the window would unload before the onbeforeunload handler could set the last KPIs.

Since KPIs are now sent in the communication iframe instead of in the dialog, the last remaining KPIs are set there before sending the blobs.

orphaned now means, 100% of the time, no assertion was generated in the dialog.

fixes #2280
Merge pull request #3517 from shane-tomlinson/refactor_simplify_email_chosen

Cleanup on the "email_chosen" state and reduce duplication of code.
Merge pull request #3516 from mozilla/issue_2280_missing_kpi_fields

Issue 2280 missing kpi fields

This had an r+ already, merging!
my previous "fix" was wrong in some cases; this is perfect now!
Merge pull request #3542 from jrgm/fix-inspect-localstorage

fix scripts/inspect_localstorage to handle both old-style, issuer groups and mixed.
Fix the "Unmatched start" error.

fixes #3543