player: move stuff out from base.h

These are only really used in device.c, so let's just move these
helpers there.
player: only include socket-stuff for client-builds

While we're at it, move this to device.h instead of base.h to
reduce global complexity a bit.
editor: make space enter value

Previously we were discarding it. But let's be consistent with the
logic of the other keys instead.
editor: superficial code-style clean-ups

This should be entirely non-functional changes.