Uhhh, huge revamp leaving a few externals to CM (likesqlite)

Change-Id: I63f36ac21b74ab365ef898acf2717cffad83dd1d