Add code to generate ASCII-art socket diagrams

The web GUI may be able to do this nicer, but when testing from the
shell we need some way to display results in a single screen for the
user.

An all-closed 4x4 socket looks like this:
O-O-O-O
|X|X|X|
O-O-O-O
|X|X|X|
O-O-O-O
|X|X|X|
O-O-O-O

I spot-checked a 16x16 drawing, and I'm pretty sure it's correct, but I
only had time to be thorough about the 4x4.