Limited Invulnerability
During gameplay, pause, then hold Up + Select and then press A + B. A sound will confirm correct code entry. This invulnerability will last for the stage, but it won't protect you from everything (namely, spikes and bosses may still be able to hurt you).
Stage Select
At the title screen, hold Down, then press A+B multiple times, equal to the number of the stage you want to go to. Any more than 15 presses will bring you to the ending. Press Start once you're sure of which level to go to.