major bugs in frame construction

* medium size frame s/b < not <=
* only send onTick to upgraded clients
* fixed large frames because PHP does not have a 64bit int
* added headers, COOKIE, SESSION to $client object