Initial commit of code that locks and unlocks and does basic on-demand polling.