Add back the theme stuff from cm && fix compiling problems

Change-Id: I522ecd7c4968a03cd5a2afd1bd3bc00b5ddd122e