Integrated All-optical Memories/Switches in a Photonic Crystal Chip