Move common menu fuctions into menu.c/h (#59)