Refactor encoder to LibraryEncoder.
Layout improvements.

Spacers and hug_width to try and keep things from sprawling.