The PD window code is all in pdwindow.tcl. The console log part is the 'text' widget:
text .pdwindow.text -relief raised -bd 2 -font {-size 10} \
-highlightthickness 0 -borderwidth 1 -relief flat \
-yscrollcommand ".pdwindow.scroll set" -width 60 \
-undo true -autoseparators true -maxundo -1
As for the Media menu, I think it could be useful for putting your own patches on, like the addmypatchstomedia.tcl plugin does:
.hc
----------------------------------------------------------------------------
Programs should be written for people to read, and only incidentally for machines to execute.
- from Structure and Interpretation of Computer Programs