config made templated.

different checkouts will have different configs.
auth config moved to config, media started

sock.onmessage abstracted to sock.onchatmaessage (this is a star of media
    integration)
also, client application is checked in token verification.
wrapped socked finished.