Register and unregister buttons and more xhp magic.