Added state / transaction timeout to device code

also added debounce, changed test mode, implemented lazy stock counting
/ primitive sold out notification
Added "sold out" logic

uses dead reckoning based on user-reported initial stock value and
number of vends