Well, finally I've got this thing working. I got suspicious of Microchip's prototype board and just breadboarded the whole thing, and it worked perfectly.

I think I will go with an external ceramic oscillator for the final circuit, for the sake of reliability. If I hook up a 20mhz oscillator, all I need to do is set @ device EXTRC_OSC_NOCLKOUT, define OSC 20, and get rid of the OSCCON completely, right?