Cherry picks from AOSP / CM Recovery
6.48.5: CWM dies here

Start of previous commit (cherry pick AOSP...), PhilZ Touch will break with CWM upstream

Further commits will merge more changes from AOSP/ CM Recovery
At some point, this could stop and we move to c++

For now, stick to 6.48.4 as release version. For now, this is still work in progress