Consolidated generation of button state nodes into an inner type.  Part of #12.