Massive refactor of the masthead button system.