Implemented most of the general menu functionality.