Fixed bugs with buttons.

The buttons now work 100%, though there are some visual things that aren't quite
right, but I can do those later. The problem was that I was sorting all kinds
of stuff alphabetically, and that was putting things out of order, it was bad.
So it's all good now! I can merge, I think.