Added inline docs, user state listening, cleanup.

Functions now all return things nicely, along with resetting the idle
count when the user does something.