Rearranged code so duplicate code could be removed.
Meta curses are now completely supported.