Rejigger type name printing. Fixes issue 1047
R=johnlenz
Fix NPE in AttachJsDoc. Fixes issue 1073.
R=blickly