Rebase on latest cm11 sources

Sorry for the dirty way of rebasing it but I had problems in the procedure.