Lengthy modifications

Taken from omni
https://gerrit.omnirom.org/#/c/6652/1

Change-Id: I639a55fd0969f58ad2fc344c79ebfce8f1d93951
Merge "Lengthy modifications" into kitkat