Regularize message construction

A number of small changes that combined make the message passing much easier to follow. Both the client and server now have a single place in the code that constructs the message envelope, ensuring that all messages use the same format. All messages now have a sequence number which we can use to track replies, although it's not yet used.

There are also some unrelated changes that let the client connect to the server even if it can't initialize the image editor or filepicker, which helps testing a great deal when you don't have internet access. Adds a local copy of jQuery as well.