Fix for d2 rewrite issue and a related encoding bug that was affecting complex and compound typed path keys.
Added tests for super-resources with compelx and compound keys.

RB=252372
R=gogenc,kparikh,si-dev,zzhu
A=gogenc,zzhu