Select two player mode, then enter "hg?" as your initials. Return to the main menu and start a single player game. At the world selection screen, hold L + R and press Select to unlock all levels. To lock all levels, hold L + R and press Select again.
Place first on all high score boards for all stages in a world to unlock bonus stages for that world.