.bin: Add `server`

Move the `server` function to its own file, while also making it:

 * work with Python 3
 * better detect when the server is up and running