Bug 1059663 - Input Management script code cleanup

- Move group-to-type reverse generation to InputLayouts since it's used only there
- Move handling of mozChrome Event into handleEvent
- Extract onTransitionStateChange
- Eliminate use of "self"
- Rename |showAll| to |showImeMenu|
- Elimiate interchangeability between |type| and |group| to better reflect the idea in Input Management
Merge pull request #23716 from mnjul/bug_1059663_input_management_codes_cleanup

Bug 1059663 Input Management Codes cleanup. r=timdream

- Move group-to-type reverse mapping generation to |InputLayouts| since it's used only there
- Move handling of mozChrome events into |handleEvent()|
- Extract |onTransitionStateChange|
- Eliminate use of |self|
- Rename |showAll| to |showImeMenu|
- Eliminate interchangeability between |type| and |group| to better reflect the idea in Input Management