Ferrofluid-based microchip pump and valve