New step tracking function
Flatten state scope
Full lightweight states / robust machine for step detection