Flexible intervals & bugfixes

This pull request fixes a few issues that I experienced implementing this in an application.

    1. Presence starts running before "client" code can change the "state" function - meaning on every load their state gets set to "online".
    2. The interval isn't configurable
    3. State changes get skipped if the client sessionId is set to "waiting" - this has a large effect when you increase the client interval.

The only questionable issue with these changes - is whether it is bad for the client to set their own ID - but as there's no other trust mechanism (eg, server can't enforce which ID a client wants to send) then it probably doesn't matter.