Exceptional generalized geometry and tensor hierarchy