Factor out version into constant.

This allows the version to be used elsewhere if needs be, pulls it out so it's
easier to find when incrementing the version, and also makes it look
sufficiently important.

Also, imo, it's a magic string, so it shouldn't be stuck in the middle of a
command!
Introduce methods in server.

This factors out the processes of reading and processing a command by
introducing two private methods.

This imo makes the high-level logic read better and also suggests possible
method object introduction later (the same things are being passed into the various
methods).