Added server.publish().

This adds server.publish(), extracting the behavior from the Client prototype into the Server prototype.

It should add everything that is needed for #81.

This change is missing any form of docs, I'll add it asap.

Any test/feedback is welcome, cc @wanderer @teomurgi.