Made states swap at the end of a frame. If it's done earlier, the code could be working with a dead object.
Began work on the menu interfaces.