Lots of code cleanup and refactoring.

ResizableBox/Menu now derive from Entity.

Box/Menu functionality is not completely restored (some commented code).