A Programmable Microfluidic Finite State Machine For The Autonomous Lab On A Chip