Medium-resolution integral-field spectroscopy for high-contrast exoplanet imaging: Molecule maps of the $β$ Pictoris system with SINFONI