Implemented the PanesLibrary and get it (mostly) working.