Compact packaging for high-speed optocouplers