Magnetic separation in microfluidic systems