Clean up pipe implementation to avoid tuple packing at runtime and add pipe_matching/3