General cleanup

I got this far before my patience wore out.